diff --git a/deployments/polygon/FrontendLib.json b/deployments/polygon/FrontendLib.json new file mode 100644 index 00000000..60e74184 --- /dev/null +++ b/deployments/polygon/FrontendLib.json @@ -0,0 +1,89 @@ +{ + "address": "0x80D92C9cEEb4743D606259793f4553CBA2b5046F", + "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": "0x475762aaa0baae53196b6b871ce732eb5f7ace12d8568b4309e9707222b444db", + "receipt": { + "to": null, + "from": "0x9FBE1230aa270F55870DD0c631ef3f4cC54A1Dda", + "contractAddress": "0x80D92C9cEEb4743D606259793f4553CBA2b5046F", + "transactionIndex": 49, + "gasUsed": "224972", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000400000000100001000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000008000000000000000000000000200000000000000000000000000000000000000000000000000000000001004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x0ad0ee1b473f735a9e6d18252149b5c8bb71bf804a5b44a441cc47102cadaf76", + "transactionHash": "0x475762aaa0baae53196b6b871ce732eb5f7ace12d8568b4309e9707222b444db", + "logs": [ + { + "transactionIndex": 49, + "blockNumber": 37055754, + "transactionHash": "0x475762aaa0baae53196b6b871ce732eb5f7ace12d8568b4309e9707222b444db", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x0000000000000000000000009fbe1230aa270f55870dd0c631ef3f4cc54a1dda", + "0x0000000000000000000000007c7379531b2aee82e4ca06d4175d13b9cbeafd49" + ], + "data": "0x000000000000000000000000000000000000000000000000000733999fbb2ae8000000000000000000000000000000000000000000000000243048d9b6edf74100000000000000000000000000000000000000000001bdcaa9a5cc01b6fabf2b000000000000000000000000000000000000000000000000242915401732cc5900000000000000000000000000000000000000000001bdcaa9acff9b56b5ea13", + "logIndex": 198, + "blockHash": "0x0ad0ee1b473f735a9e6d18252149b5c8bb71bf804a5b44a441cc47102cadaf76" + } + ], + "blockNumber": 37055754, + "cumulativeGasUsed": "7306502", + "status": 1, + "byzantium": true + }, + "args": [ + "0x10b27d9efa4A1B65412188b6f4F29e64Cf5e0146" + ], + "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