From d264267a8e25d7c0a82282e4b854dc9ba07428b6 Mon Sep 17 00:00:00 2001 From: Burak Benligiray Date: Fri, 1 Mar 2024 08:01:07 +0300 Subject: [PATCH] Add Blast testnet and mainnet --- deployments/blast-sepolia-testnet/.chainId | 1 + .../AccessControlRegistry.json | 518 +++++ .../blast-sepolia-testnet/Api3Market.json | 1702 +++++++++++++++++ .../blast-sepolia-testnet/Api3ServerV1.json | 1137 +++++++++++ .../OwnableCallForwarder.json | 202 ++ .../blast-sepolia-testnet/ProxyFactory.json | 501 +++++ .../9a9784f0166e92dcfa54df2d2c909051.json | 255 +++ deployments/blast/.chainId | 1 + deployments/blast/AccessControlRegistry.json | 518 +++++ deployments/blast/Api3ServerV1.json | 1137 +++++++++++ deployments/blast/OrderPayable.json | 441 +++++ deployments/blast/OwnableCallForwarder.json | 202 ++ deployments/blast/ProxyFactory.json | 501 +++++ .../16343b63dc5abcc6d4d0ea75eb689f42.json | 330 ++++ deployments/deployment-block-numbers.json | 15 +- deployments/manager-multisig.json | 1 + deployments/references.json | 15 +- example.env | 12 +- package.json | 2 +- src/supported-chains.js | 3 + yarn.lock | 8 +- 21 files changed, 7492 insertions(+), 10 deletions(-) create mode 100644 deployments/blast-sepolia-testnet/.chainId create mode 100644 deployments/blast-sepolia-testnet/AccessControlRegistry.json create mode 100644 deployments/blast-sepolia-testnet/Api3Market.json create mode 100644 deployments/blast-sepolia-testnet/Api3ServerV1.json create mode 100644 deployments/blast-sepolia-testnet/OwnableCallForwarder.json create mode 100644 deployments/blast-sepolia-testnet/ProxyFactory.json create mode 100644 deployments/blast-sepolia-testnet/solcInputs/9a9784f0166e92dcfa54df2d2c909051.json create mode 100644 deployments/blast/.chainId create mode 100644 deployments/blast/AccessControlRegistry.json create mode 100644 deployments/blast/Api3ServerV1.json create mode 100644 deployments/blast/OrderPayable.json create mode 100644 deployments/blast/OwnableCallForwarder.json create mode 100644 deployments/blast/ProxyFactory.json create mode 100644 deployments/blast/solcInputs/16343b63dc5abcc6d4d0ea75eb689f42.json diff --git a/deployments/blast-sepolia-testnet/.chainId b/deployments/blast-sepolia-testnet/.chainId new file mode 100644 index 00000000..771a9653 --- /dev/null +++ b/deployments/blast-sepolia-testnet/.chainId @@ -0,0 +1 @@ +168587773 \ No newline at end of file diff --git a/deployments/blast-sepolia-testnet/AccessControlRegistry.json b/deployments/blast-sepolia-testnet/AccessControlRegistry.json new file mode 100644 index 00000000..918a7fb2 --- /dev/null +++ b/deployments/blast-sepolia-testnet/AccessControlRegistry.json @@ -0,0 +1,518 @@ +{ + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "rootRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "manager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "InitializedManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "adminRole", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "InitializedRole", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "initializeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "adminRole", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "initializeRoleAndGrantToSender", + "outputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xfafeb823416cbcee027adc448fb814c61b18d4c8c1c80232d4def3e6ec9197a8", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 14, + "gasUsed": "1062014", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x25a908992702f0841e19a3e98d866846aad7e1fe90826b988a7a4d4e32675ecc", + "transactionHash": "0xfafeb823416cbcee027adc448fb814c61b18d4c8c1c80232d4def3e6ec9197a8", + "logs": [], + "blockNumber": 1693125, + "cumulativeGasUsed": "3719547", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "9a9784f0166e92dcfa54df2d2c909051", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"rootRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"InitializedManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"adminRole\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"InitializedRole\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"}],\"name\":\"initializeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"adminRole\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"initializeRoleAndGrantToSender\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Each user is called a \\\"manager\\\", and is the only member of their root role. Starting from this root role, they can create an arbitrary tree of roles and grant these to accounts. Each role has a description, and roles adminned by the same role cannot have the same description.\",\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initializeManager(address)\":{\"details\":\"Anyone can initialize a manager. An uninitialized manager attempting to initialize a role will be initialized automatically. Once a manager is initialized, subsequent initializations have no effect.\",\"params\":{\"manager\":\"Manager address to be initialized\"}},\"initializeRoleAndGrantToSender(bytes32,string)\":{\"details\":\"If the sender should not have the initialized role, they should explicitly renounce it after initializing it. Once a role is initialized, subsequent initializations have no effect other than granting the role to the sender. The sender must be a member of `adminRole`. `adminRole` value is not validated because the sender cannot have the `bytes32(0)` role. If the sender is an uninitialized manager that is initializing a role directly under their root role, manager initialization will happen automatically, which will grant the sender `adminRole` and allow them to initialize the role.\",\"params\":{\"adminRole\":\"Admin role to be assigned to the initialized role\",\"description\":\"Human-readable description of the initialized role\"},\"returns\":{\"role\":\"Initialized role\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"renounceRole(bytes32,address)\":{\"details\":\"Overriden to disallow managers from renouncing their root roles. `role` and `account` are not validated because `AccessControl.renounceRole` will revert if either of them is zero.\",\"params\":{\"account\":\"Account to renounce the role\",\"role\":\"Role to be renounced\"}},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}}},\"title\":\"Contract that allows users to manage independent, tree-shaped access control tables\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initializeManager(address)\":{\"notice\":\"Initializes the manager by initializing its root role and granting it to them\"},\"initializeRoleAndGrantToSender(bytes32,string)\":{\"notice\":\"Initializes a role by setting its admin role and grants it to the sender\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"renounceRole(bytes32,address)\":{\"notice\":\"Called by the account to renounce the role\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"}},\"notice\":\"Multiple contracts can refer to this contract to check if their users have granted accounts specific roles. Therefore, it aims to keep all access control roles of its users in this single contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/AccessControlRegistry.sol\":\"AccessControlRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/access/AccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/access/AccessControl.sol\\\";\\nimport \\\"../utils/SelfMulticall.sol\\\";\\nimport \\\"./RoleDeriver.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistry.sol\\\";\\n\\n/// @title Contract that allows users to manage independent, tree-shaped access\\n/// control tables\\n/// @notice Multiple contracts can refer to this contract to check if their\\n/// users have granted accounts specific roles. Therefore, it aims to keep all\\n/// access control roles of its users in this single contract.\\n/// @dev Each user is called a \\\"manager\\\", and is the only member of their root\\n/// role. Starting from this root role, they can create an arbitrary tree of\\n/// roles and grant these to accounts. Each role has a description, and roles\\n/// adminned by the same role cannot have the same description.\\ncontract AccessControlRegistry is\\n AccessControl,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @notice Initializes the manager by initializing its root role and\\n /// granting it to them\\n /// @dev Anyone can initialize a manager. An uninitialized manager\\n /// attempting to initialize a role will be initialized automatically.\\n /// Once a manager is initialized, subsequent initializations have no\\n /// effect.\\n /// @param manager Manager address to be initialized\\n function initializeManager(address manager) public override {\\n require(manager != address(0), \\\"Manager address zero\\\");\\n bytes32 rootRole = _deriveRootRole(manager);\\n if (!hasRole(rootRole, manager)) {\\n _grantRole(rootRole, manager);\\n emit InitializedManager(rootRole, manager, _msgSender());\\n }\\n }\\n\\n /// @notice Called by the account to renounce the role\\n /// @dev Overriden to disallow managers from renouncing their root roles.\\n /// `role` and `account` are not validated because\\n /// `AccessControl.renounceRole` will revert if either of them is zero.\\n /// @param role Role to be renounced\\n /// @param account Account to renounce the role\\n function renounceRole(\\n bytes32 role,\\n address account\\n ) public override(AccessControl, IAccessControl) {\\n require(\\n role != _deriveRootRole(account),\\n \\\"role is root role of account\\\"\\n );\\n AccessControl.renounceRole(role, account);\\n }\\n\\n /// @notice Initializes a role by setting its admin role and grants it to\\n /// the sender\\n /// @dev If the sender should not have the initialized role, they should\\n /// explicitly renounce it after initializing it.\\n /// Once a role is initialized, subsequent initializations have no effect\\n /// other than granting the role to the sender.\\n /// The sender must be a member of `adminRole`. `adminRole` value is not\\n /// validated because the sender cannot have the `bytes32(0)` role.\\n /// If the sender is an uninitialized manager that is initializing a role\\n /// directly under their root role, manager initialization will happen\\n /// automatically, which will grant the sender `adminRole` and allow them\\n /// to initialize the role.\\n /// @param adminRole Admin role to be assigned to the initialized role\\n /// @param description Human-readable description of the initialized role\\n /// @return role Initialized role\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external override returns (bytes32 role) {\\n require(bytes(description).length > 0, \\\"Role description empty\\\");\\n role = _deriveRole(adminRole, description);\\n // AccessControl roles have `DEFAULT_ADMIN_ROLE` (i.e., `bytes32(0)`)\\n // as their `adminRole` by default. No account in AccessControlRegistry\\n // can possibly have that role, which means all initialized roles will\\n // have non-default admin roles, and vice versa.\\n if (getRoleAdmin(role) == DEFAULT_ADMIN_ROLE) {\\n if (adminRole == _deriveRootRole(_msgSender())) {\\n initializeManager(_msgSender());\\n }\\n _setRoleAdmin(role, adminRole);\\n emit InitializedRole(role, adminRole, description, _msgSender());\\n }\\n grantRole(role, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x86d904bfa0137a90286311c0e03627272ebef61cac537e3aa26b6f992942429b\",\"license\":\"MIT\"},\"contracts/access/RoleDeriver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will derive\\n/// AccessControlRegistry roles\\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\\n/// derive roles, it should inherit this contract instead of re-implementing\\n/// the logic\\ncontract RoleDeriver {\\n /// @notice Derives the root role of the manager\\n /// @param manager Manager address\\n /// @return rootRole Root role\\n function _deriveRootRole(\\n address manager\\n ) internal pure returns (bytes32 rootRole) {\\n rootRole = keccak256(abi.encodePacked(manager));\\n }\\n\\n /// @notice Derives the role using its admin role and description\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param description Human-readable description of the role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n string memory description\\n ) internal pure returns (bytes32 role) {\\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\\n }\\n\\n /// @notice Derives the role using its admin role and description hash\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param descriptionHash Hash of the human-readable description of the\\n /// role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n bytes32 descriptionHash\\n ) internal pure returns (bytes32 role) {\\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\\n }\\n}\\n\",\"keccak256\":\"0x488adb3cb7031415d4a195230753a0ac8f9f610e6db7a571529a350e29c97ed6\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\\n event InitializedManager(\\n bytes32 indexed rootRole,\\n address indexed manager,\\n address sender\\n );\\n\\n event InitializedRole(\\n bytes32 indexed role,\\n bytes32 indexed adminRole,\\n string description,\\n address sender\\n );\\n\\n function initializeManager(address manager) external;\\n\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external returns (bytes32 role);\\n}\\n\",\"keccak256\":\"0x87066db894a24118df39a557d00c0a6529c39196011c03f809ca8cce1644e027\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50611244806100206000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806373e9836211610081578063a217fddf1161005b578063a217fddf146101cd578063ac9650d8146101d5578063d547741f146101f557600080fd5b806373e98362146101705780637f7120fe1461018357806391d148541461019657600080fd5b80632f2ff15d116100b25780632f2ff15d1461012757806336568abe1461013c578063437b91161461014f57600080fd5b806301ffc9a7146100ce578063248a9ca3146100f6575b600080fd5b6100e16100dc366004610d7b565b610208565b60405190151581526020015b60405180910390f35b610119610104366004610dbd565b60009081526020819052604090206001015490565b6040519081526020016100ed565b61013a610135366004610df2565b6102a1565b005b61013a61014a366004610df2565b6102cb565b61016261015d366004610e1e565b610364565b6040516100ed929190610f38565b61011961017e366004610f91565b6104ca565b61013a61019136600461100d565b610611565b6100e16101a4366004610df2565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610119600081565b6101e86101e3366004610e1e565b61071d565b6040516100ed9190611028565b61013a610203366004610df2565b61089e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061029b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152602081905260409020600101546102bc816108c3565b6102c683836108d0565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036103565760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b610360828261096e565b5050565b606080828067ffffffffffffffff8111156103815761038161103b565b6040519080825280602002602001820160405280156103aa578160200160208202803683370190505b5092508067ffffffffffffffff8111156103c6576103c661103b565b6040519080825280602002602001820160405280156103f957816020015b60608152602001906001900390816103e45790505b50915060005b818110156104c1573086868381811061041a5761041a611051565b905060200281019061042c9190611067565b60405161043a9291906110b5565b600060405180830381855af49150503d8060008114610475576040519150601f19603f3d011682016040523d82523d6000602084013e61047a565b606091505b5085838151811061048d5761048d611051565b602002602001018584815181106104a6576104a6611051565b602090810291909101019190915290151590526001016103ff565b50509250929050565b6000816105195760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161034d565b6105598484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506109f692505050565b60008181526020819052604090206001015490915061060057604080513360601b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012084036105b8576105b833610611565b6105c28185610a4b565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585336040516105f7939291906110c5565b60405180910390a35b61060a81336102a1565b9392505050565b6001600160a01b0381166106675760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161034d565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610360576106d181836108d0565b6001600160a01b038216817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d336040516001600160a01b03909116815260200160405180910390a35050565b6060818067ffffffffffffffff8111156107395761073961103b565b60405190808252806020026020018201604052801561076c57816020015b60608152602001906001900390816107575790505b50915060005b818110156108965760003086868481811061078f5761078f611051565b90506020028101906107a19190611067565b6040516107af9291906110b5565b600060405180830381855af49150503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b5085848151811061080257610802611051565b602090810291909101015290508061088d57600084838151811061082857610828611051565b602002602001015190506000815111156108455780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161034d565b50600101610772565b505092915050565b6000828152602081905260409020600101546108b9816108c3565b6102c68383610a96565b6108cd8133610b15565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610360576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561092a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146109ec5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161034d565b6103608282610a96565b600061060a8383604051602001610a0d9190611107565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610360576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661036057610b4681610b88565b610b51836020610b9a565b604051602001610b62929190611123565b60408051601f198184030181529082905262461bcd60e51b825261034d916004016111a4565b606061029b6001600160a01b03831660145b60606000610ba98360026111cd565b610bb49060026111e4565b67ffffffffffffffff811115610bcc57610bcc61103b565b6040519080825280601f01601f191660200182016040528015610bf6576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610c2d57610c2d611051565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610c7857610c78611051565b60200101906001600160f81b031916908160001a9053506000610c9c8460026111cd565b610ca79060016111e4565b90505b6001811115610d2c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610ce857610ce8611051565b1a60f81b828281518110610cfe57610cfe611051565b60200101906001600160f81b031916908160001a90535060049490941c93610d25816111f7565b9050610caa565b50831561060a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034d565b600060208284031215610d8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461060a57600080fd5b600060208284031215610dcf57600080fd5b5035919050565b80356001600160a01b0381168114610ded57600080fd5b919050565b60008060408385031215610e0557600080fd5b82359150610e1560208401610dd6565b90509250929050565b60008060208385031215610e3157600080fd5b823567ffffffffffffffff80821115610e4957600080fd5b818501915085601f830112610e5d57600080fd5b813581811115610e6c57600080fd5b8660208260051b8501011115610e8157600080fd5b60209290920196919550909350505050565b60005b83811015610eae578181015183820152602001610e96565b50506000910152565b60008151808452610ecf816020860160208601610e93565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610f2b578284038952610f19848351610eb7565b98850198935090840190600101610f01565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610f73578151151584529284019290840190600101610f55565b50505083810382850152610f878186610ee3565b9695505050505050565b600080600060408486031215610fa657600080fd5b83359250602084013567ffffffffffffffff80821115610fc557600080fd5b818601915086601f830112610fd957600080fd5b813581811115610fe857600080fd5b876020828501011115610ffa57600080fd5b6020830194508093505050509250925092565b60006020828403121561101f57600080fd5b61060a82610dd6565b60208152600061060a6020830184610ee3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261107e57600080fd5b83018035915067ffffffffffffffff82111561109957600080fd5b6020019150368190038213156110ae57600080fd5b9250929050565b8183823760009101908152919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611119818460208701610e93565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161115b816017850160208801610e93565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611198816028840160208801610e93565b01602801949350505050565b60208152600061060a6020830184610eb7565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029b5761029b6111b7565b8082018082111561029b5761029b6111b7565b600081611206576112066111b7565b50600019019056fea2646970667358221220ae4f3421aaad5b1af12510ac03d7ec2649209de4471e48601a849e44cc2f1d5864736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c806373e9836211610081578063a217fddf1161005b578063a217fddf146101cd578063ac9650d8146101d5578063d547741f146101f557600080fd5b806373e98362146101705780637f7120fe1461018357806391d148541461019657600080fd5b80632f2ff15d116100b25780632f2ff15d1461012757806336568abe1461013c578063437b91161461014f57600080fd5b806301ffc9a7146100ce578063248a9ca3146100f6575b600080fd5b6100e16100dc366004610d7b565b610208565b60405190151581526020015b60405180910390f35b610119610104366004610dbd565b60009081526020819052604090206001015490565b6040519081526020016100ed565b61013a610135366004610df2565b6102a1565b005b61013a61014a366004610df2565b6102cb565b61016261015d366004610e1e565b610364565b6040516100ed929190610f38565b61011961017e366004610f91565b6104ca565b61013a61019136600461100d565b610611565b6100e16101a4366004610df2565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610119600081565b6101e86101e3366004610e1e565b61071d565b6040516100ed9190611028565b61013a610203366004610df2565b61089e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061029b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152602081905260409020600101546102bc816108c3565b6102c683836108d0565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036103565760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b610360828261096e565b5050565b606080828067ffffffffffffffff8111156103815761038161103b565b6040519080825280602002602001820160405280156103aa578160200160208202803683370190505b5092508067ffffffffffffffff8111156103c6576103c661103b565b6040519080825280602002602001820160405280156103f957816020015b60608152602001906001900390816103e45790505b50915060005b818110156104c1573086868381811061041a5761041a611051565b905060200281019061042c9190611067565b60405161043a9291906110b5565b600060405180830381855af49150503d8060008114610475576040519150601f19603f3d011682016040523d82523d6000602084013e61047a565b606091505b5085838151811061048d5761048d611051565b602002602001018584815181106104a6576104a6611051565b602090810291909101019190915290151590526001016103ff565b50509250929050565b6000816105195760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161034d565b6105598484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506109f692505050565b60008181526020819052604090206001015490915061060057604080513360601b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012084036105b8576105b833610611565b6105c28185610a4b565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585336040516105f7939291906110c5565b60405180910390a35b61060a81336102a1565b9392505050565b6001600160a01b0381166106675760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161034d565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610360576106d181836108d0565b6001600160a01b038216817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d336040516001600160a01b03909116815260200160405180910390a35050565b6060818067ffffffffffffffff8111156107395761073961103b565b60405190808252806020026020018201604052801561076c57816020015b60608152602001906001900390816107575790505b50915060005b818110156108965760003086868481811061078f5761078f611051565b90506020028101906107a19190611067565b6040516107af9291906110b5565b600060405180830381855af49150503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b5085848151811061080257610802611051565b602090810291909101015290508061088d57600084838151811061082857610828611051565b602002602001015190506000815111156108455780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161034d565b50600101610772565b505092915050565b6000828152602081905260409020600101546108b9816108c3565b6102c68383610a96565b6108cd8133610b15565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610360576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561092a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146109ec5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161034d565b6103608282610a96565b600061060a8383604051602001610a0d9190611107565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610360576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661036057610b4681610b88565b610b51836020610b9a565b604051602001610b62929190611123565b60408051601f198184030181529082905262461bcd60e51b825261034d916004016111a4565b606061029b6001600160a01b03831660145b60606000610ba98360026111cd565b610bb49060026111e4565b67ffffffffffffffff811115610bcc57610bcc61103b565b6040519080825280601f01601f191660200182016040528015610bf6576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610c2d57610c2d611051565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610c7857610c78611051565b60200101906001600160f81b031916908160001a9053506000610c9c8460026111cd565b610ca79060016111e4565b90505b6001811115610d2c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610ce857610ce8611051565b1a60f81b828281518110610cfe57610cfe611051565b60200101906001600160f81b031916908160001a90535060049490941c93610d25816111f7565b9050610caa565b50831561060a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034d565b600060208284031215610d8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461060a57600080fd5b600060208284031215610dcf57600080fd5b5035919050565b80356001600160a01b0381168114610ded57600080fd5b919050565b60008060408385031215610e0557600080fd5b82359150610e1560208401610dd6565b90509250929050565b60008060208385031215610e3157600080fd5b823567ffffffffffffffff80821115610e4957600080fd5b818501915085601f830112610e5d57600080fd5b813581811115610e6c57600080fd5b8660208260051b8501011115610e8157600080fd5b60209290920196919550909350505050565b60005b83811015610eae578181015183820152602001610e96565b50506000910152565b60008151808452610ecf816020860160208601610e93565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610f2b578284038952610f19848351610eb7565b98850198935090840190600101610f01565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610f73578151151584529284019290840190600101610f55565b50505083810382850152610f878186610ee3565b9695505050505050565b600080600060408486031215610fa657600080fd5b83359250602084013567ffffffffffffffff80821115610fc557600080fd5b818601915086601f830112610fd957600080fd5b813581811115610fe857600080fd5b876020828501011115610ffa57600080fd5b6020830194508093505050509250925092565b60006020828403121561101f57600080fd5b61060a82610dd6565b60208152600061060a6020830184610ee3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261107e57600080fd5b83018035915067ffffffffffffffff82111561109957600080fd5b6020019150368190038213156110ae57600080fd5b9250929050565b8183823760009101908152919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611119818460208701610e93565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161115b816017850160208801610e93565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611198816028840160208801610e93565b01602801949350505050565b60208152600061060a6020830184610eb7565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029b5761029b6111b7565b8082018082111561029b5761029b6111b7565b600081611206576112066111b7565b50600019019056fea2646970667358221220ae4f3421aaad5b1af12510ac03d7ec2649209de4471e48601a849e44cc2f1d5864736f6c63430008110033", + "devdoc": { + "details": "Each user is called a \"manager\", and is the only member of their root role. Starting from this root role, they can create an arbitrary tree of roles and grant these to accounts. Each role has a description, and roles adminned by the same role cannot have the same description.", + "kind": "dev", + "methods": { + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "initializeManager(address)": { + "details": "Anyone can initialize a manager. An uninitialized manager attempting to initialize a role will be initialized automatically. Once a manager is initialized, subsequent initializations have no effect.", + "params": { + "manager": "Manager address to be initialized" + } + }, + "initializeRoleAndGrantToSender(bytes32,string)": { + "details": "If the sender should not have the initialized role, they should explicitly renounce it after initializing it. Once a role is initialized, subsequent initializations have no effect other than granting the role to the sender. The sender must be a member of `adminRole`. `adminRole` value is not validated because the sender cannot have the `bytes32(0)` role. If the sender is an uninitialized manager that is initializing a role directly under their root role, manager initialization will happen automatically, which will grant the sender `adminRole` and allow them to initialize the role.", + "params": { + "adminRole": "Admin role to be assigned to the initialized role", + "description": "Human-readable description of the initialized role" + }, + "returns": { + "role": "Initialized role" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "renounceRole(bytes32,address)": { + "details": "Overriden to disallow managers from renouncing their root roles. `role` and `account` are not validated because `AccessControl.renounceRole` will revert if either of them is zero.", + "params": { + "account": "Account to renounce the role", + "role": "Role to be renounced" + } + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + } + }, + "title": "Contract that allows users to manage independent, tree-shaped access control tables", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "initializeManager(address)": { + "notice": "Initializes the manager by initializing its root role and granting it to them" + }, + "initializeRoleAndGrantToSender(bytes32,string)": { + "notice": "Initializes a role by setting its admin role and grants it to the sender" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "renounceRole(bytes32,address)": { + "notice": "Called by the account to renounce the role" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + } + }, + "notice": "Multiple contracts can refer to this contract to check if their users have granted accounts specific roles. Therefore, it aims to keep all access control roles of its users in this single contract.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 11107, + "contract": "contracts/access/AccessControlRegistry.sol:AccessControlRegistry", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)11102_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(RoleData)11102_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)11102_storage" + }, + "t_struct(RoleData)11102_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 11099, + "contract": "contracts/access/AccessControlRegistry.sol:AccessControlRegistry", + "label": "members", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 11101, + "contract": "contracts/access/AccessControlRegistry.sol:AccessControlRegistry", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + } + } + } +} diff --git a/deployments/blast-sepolia-testnet/Api3Market.json b/deployments/blast-sepolia-testnet/Api3Market.json new file mode 100644 index 00000000..26c8d5d9 --- /dev/null +++ b/deployments/blast-sepolia-testnet/Api3Market.json @@ -0,0 +1,1702 @@ +{ + "address": "0xd262D172fE126BcA7dDc8DF183283c31Ce5b4c78", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + }, + { + "internalType": "address", + "name": "proxyFactory_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subscriptionId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sponsorWallet", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "updateParameters", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paymentAmount", + "type": "uint256" + } + ], + "name": "BoughtSubscription", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "hashValue", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "hashTimestamp", + "type": "uint256" + } + ], + "name": "RegisteredHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "hashValue", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "hashTimestamp", + "type": "uint256" + } + ], + "name": "SetHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "signers", + "type": "address[]" + } + ], + "name": "SetSigners", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subscriptionId", + "type": "bytes32" + } + ], + "name": "UpdatedCurrentSubscriptionId", + "type": "event" + }, + { + "inputs": [], + "name": "DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DAPI_PRICING_MERKLE_ROOT_HASH_TYPE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAXIMUM_DAPI_UPDATE_AGE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "airseekerRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "api3ServerV1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address payable", + "name": "sponsorWallet", + "type": "address" + }, + { + "internalType": "bytes", + "name": "dapiManagementMerkleData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "updateParameters", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dapiPricingMerkleData", + "type": "bytes" + } + ], + "name": "buySubscription", + "outputs": [ + { + "internalType": "bytes32", + "name": "subscriptionId", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + } + ], + "name": "computeExpectedSponsorWalletBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "expectedSponsorWalletBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "updateParameters", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded", + "outputs": [ + { + "internalType": "uint256", + "name": "expectedSponsorWalletBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "containsBytecode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "dapiNameToCurrentSubscriptionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxy", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxyWithOev", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + } + ], + "name": "getDapiData", + "outputs": [ + { + "internalType": "bytes", + "name": "dataFeedDetails", + "type": "bytes" + }, + { + "internalType": "int224", + "name": "dapiValue", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "dapiTimestamp", + "type": "uint32" + }, + { + "internalType": "int224[]", + "name": "beaconValues", + "type": "int224[]" + }, + { + "internalType": "uint32[]", + "name": "beaconTimestamps", + "type": "uint32[]" + }, + { + "internalType": "bytes[]", + "name": "updateParameters", + "type": "bytes[]" + }, + { + "internalType": "uint32[]", + "name": "endTimestamps", + "type": "uint32[]" + }, + { + "internalType": "uint224[]", + "name": "dailyPrices", + "type": "uint224[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "getDataFeedData", + "outputs": [ + { + "internalType": "bytes", + "name": "dataFeedDetails", + "type": "bytes" + }, + { + "internalType": "int224", + "name": "dataFeedValue", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "dataFeedTimestamp", + "type": "uint32" + }, + { + "internalType": "int224[]", + "name": "beaconValues", + "type": "int224[]" + }, + { + "internalType": "uint32[]", + "name": "beaconTimestamps", + "type": "uint32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + } + ], + "name": "getHashValue", + "outputs": [ + { + "internalType": "bytes32", + "name": "hashValue", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "hashTypeToSignersHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "hashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "value", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxyFactory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "dataFeedDetails", + "type": "bytes" + } + ], + "name": "registerDataFeed", + "outputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "hashValue", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "hashTimestamp", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "signatures", + "type": "bytes[]" + } + ], + "name": "registerHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "hashValue", + "type": "bytes32" + } + ], + "name": "setHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashType", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "signers", + "type": "address[]" + } + ], + "name": "setSigners", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "signatureDelegationHashType", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subscriptionId", + "type": "bytes32" + } + ], + "name": "subscriptionIdToUpdateParameters", + "outputs": [ + { + "internalType": "bytes", + "name": "updateParameters", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "subscriptions", + "outputs": [ + { + "internalType": "bytes32", + "name": "updateParametersHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "endTimestamp", + "type": "uint32" + }, + { + "internalType": "uint224", + "name": "dailyPrice", + "type": "uint224" + }, + { + "internalType": "bytes32", + "name": "nextSubscriptionId", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "beaconIds", + "type": "bytes32[]" + } + ], + "name": "updateBeaconSetWithBeacons", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "airnode", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "templateId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "updateBeaconWithSignedData", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + } + ], + "name": "updateCurrentSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sponsorWallet", + "type": "address" + }, + { + "internalType": "bytes", + "name": "dapiManagementMerkleData", + "type": "bytes" + } + ], + "name": "updateDapiName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "airnode", + "type": "address" + }, + { + "internalType": "string", + "name": "signedApiUrl", + "type": "string" + }, + { + "internalType": "bytes", + "name": "signedApiUrlMerkleData", + "type": "bytes" + } + ], + "name": "updateSignedApiUrl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 8, + "gasUsed": "7129565", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000040000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000002000000000000000000000400000000000000000000800000000012000000000000000000000000000024000400000000000000020000000000000000000000000000000000080020000000000000000000000000000", + "blockHash": "0x8872ac92a0f7b238e5efc88ac5253f1f428048330c29d59e1dfa56f3ff4ee19b", + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 1693169, + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "address": "0xd262D172fE126BcA7dDc8DF183283c31Ce5b4c78", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" + ], + "data": "0x", + "logIndex": 17, + "blockHash": "0x8872ac92a0f7b238e5efc88ac5253f1f428048330c29d59e1dfa56f3ff4ee19b" + }, + { + "transactionIndex": 8, + "blockNumber": 1693169, + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "address": "0xd262D172fE126BcA7dDc8DF183283c31Ce5b4c78", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", + "0x00000000000000000000000081bc85f329cdb28936fbb239f734ae495121f9a6" + ], + "data": "0x", + "logIndex": 18, + "blockHash": "0x8872ac92a0f7b238e5efc88ac5253f1f428048330c29d59e1dfa56f3ff4ee19b" + }, + { + "transactionIndex": 8, + "blockNumber": 1693169, + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "address": "0x05251Ae732c9aF28FB3FB5a46660B77c6EE02f07", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d262d172fe126bca7ddc8df183283c31ce5b4c78" + ], + "data": "0x", + "logIndex": 19, + "blockHash": "0x8872ac92a0f7b238e5efc88ac5253f1f428048330c29d59e1dfa56f3ff4ee19b" + }, + { + "transactionIndex": 8, + "blockNumber": 1693169, + "transactionHash": "0x46cad581ecdc0f3c4e8f828ca23d6ce12ecff2c2e52897c8e49b85649f8a4cca", + "address": "0x05251Ae732c9aF28FB3FB5a46660B77c6EE02f07", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x000000000000000000000000d262d172fe126bca7ddc8df183283c31ce5b4c78", + "0x000000000000000000000000d262d172fe126bca7ddc8df183283c31ce5b4c78" + ], + "data": "0x", + "logIndex": 20, + "blockHash": "0x8872ac92a0f7b238e5efc88ac5253f1f428048330c29d59e1dfa56f3ff4ee19b" + } + ], + "blockNumber": 1693169, + "cumulativeGasUsed": "9019788", + "status": 1, + "byzantium": true + }, + "args": ["0x81bc85f329cDB28936FbB239f734AE495121F9A6", "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD"], + "numDeployments": 1, + "solcInputHash": "9a9784f0166e92dcfa54df2d2c909051", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"proxyFactory_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subscriptionId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sponsorWallet\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"updateParameters\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paymentAmount\",\"type\":\"uint256\"}],\"name\":\"BoughtSubscription\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"hashValue\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"hashTimestamp\",\"type\":\"uint256\"}],\"name\":\"RegisteredHash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"hashValue\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"hashTimestamp\",\"type\":\"uint256\"}],\"name\":\"SetHash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"SetSigners\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"subscriptionId\",\"type\":\"bytes32\"}],\"name\":\"UpdatedCurrentSubscriptionId\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DAPI_PRICING_MERKLE_ROOT_HASH_TYPE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAXIMUM_DAPI_UPDATE_AGE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"airseekerRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"api3ServerV1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address payable\",\"name\":\"sponsorWallet\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"dapiManagementMerkleData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"updateParameters\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"dapiPricingMerkleData\",\"type\":\"bytes\"}],\"name\":\"buySubscription\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"subscriptionId\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"}],\"name\":\"computeExpectedSponsorWalletBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedSponsorWalletBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"updateParameters\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"}],\"name\":\"computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedSponsorWalletBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"containsBytecode\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dapiNameToCurrentSubscriptionId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxyWithOev\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"}],\"name\":\"getDapiData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"dataFeedDetails\",\"type\":\"bytes\"},{\"internalType\":\"int224\",\"name\":\"dapiValue\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"dapiTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int224[]\",\"name\":\"beaconValues\",\"type\":\"int224[]\"},{\"internalType\":\"uint32[]\",\"name\":\"beaconTimestamps\",\"type\":\"uint32[]\"},{\"internalType\":\"bytes[]\",\"name\":\"updateParameters\",\"type\":\"bytes[]\"},{\"internalType\":\"uint32[]\",\"name\":\"endTimestamps\",\"type\":\"uint32[]\"},{\"internalType\":\"uint224[]\",\"name\":\"dailyPrices\",\"type\":\"uint224[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"getDataFeedData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"dataFeedDetails\",\"type\":\"bytes\"},{\"internalType\":\"int224\",\"name\":\"dataFeedValue\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"dataFeedTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int224[]\",\"name\":\"beaconValues\",\"type\":\"int224[]\"},{\"internalType\":\"uint32[]\",\"name\":\"beaconTimestamps\",\"type\":\"uint32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"}],\"name\":\"getHashValue\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashValue\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"hashTypeToSignersHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"hashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"value\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxyFactory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"dataFeedDetails\",\"type\":\"bytes\"}],\"name\":\"registerDataFeed\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hashValue\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"hashTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"signatures\",\"type\":\"bytes[]\"}],\"name\":\"registerHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"hashValue\",\"type\":\"bytes32\"}],\"name\":\"setHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hashType\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"signers\",\"type\":\"address[]\"}],\"name\":\"setSigners\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"signatureDelegationHashType\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"subscriptionId\",\"type\":\"bytes32\"}],\"name\":\"subscriptionIdToUpdateParameters\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"updateParameters\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"subscriptions\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"updateParametersHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"endTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"dailyPrice\",\"type\":\"uint224\"},{\"internalType\":\"bytes32\",\"name\":\"nextSubscriptionId\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"beaconIds\",\"type\":\"bytes32[]\"}],\"name\":\"updateBeaconSetWithBeacons\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"templateId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateBeaconWithSignedData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"}],\"name\":\"updateCurrentSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sponsorWallet\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"dapiManagementMerkleData\",\"type\":\"bytes\"}],\"name\":\"updateDapiName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"signedApiUrl\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"signedApiUrlMerkleData\",\"type\":\"bytes\"}],\"name\":\"updateSignedApiUrl\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The user is strongly recommended to use the API3 Market frontend while interacting with this contract, mostly because doing so successfully requires some amount of knowledge of other API3 contracts. Specifically, Api3Market requires the data feed for which the subscription is being purchased to be \\\"readied\\\", the correct Merkle proofs to be provided, and enough payment to be made. The API3 Market frontend will fetch the appropriate Merkle proofs, create a multicall transaction that will ready the data feed before making the call to buy the subscription, and compute the amount to be sent that will barely allow the subscription to be purchased. For most users, building such a transaction themselves would be too impractical.\",\"kind\":\"dev\",\"methods\":{\"buySubscription(bytes32,bytes32,address,bytes,bytes,uint256,uint256,bytes)\":{\"details\":\"The data feed that the dAPI name will be set to after this function is called must be readied (see `validateDataFeedReadiness()`) before calling this function. Enough funds must be sent to put the sponsor wallet balance over its expected amount after the subscription is bought. Since sponsor wallets send data feed update transactions, it is not possible to estimate what their balance will be at the time sent transactions are confirmed. To avoid transactions being reverted as a result of this, consider sending some extra.\",\"params\":{\"dapiManagementMerkleData\":\"ABI-encoded dAPI management Merkle root and proof\",\"dapiName\":\"dAPI name\",\"dapiPricingMerkleData\":\"ABI-encoded dAPI pricing Merkle root and proof\",\"dataFeedId\":\"Data feed ID\",\"duration\":\"Subscription duration\",\"price\":\"Subscription price\",\"sponsorWallet\":\"Sponsor wallet address\",\"updateParameters\":\"Update parameters\"},\"returns\":{\"subscriptionId\":\"Subscription ID\"}},\"computeExpectedSponsorWalletBalance(bytes32)\":{\"details\":\"API3 estimates the transaction fee cost of subscriptions, and prices them accordingly. The subscription fees paid for a dAPI are sent to the respective sponsor wallet, which will send the update transactions. In the case that a subscription is overpriced, the extra funds are automatically rolled over as a discount to the next subscription bought for the same dAPI. In the case that a subscription is underpriced, there is a risk of the sponsor wallet running out of funds, resulting in the subscription specs to not be met. To avoid this, API3 should poll this function for all active dAPI names, check the respective sponsor wallet balances, and top up the sponsor wallets as necessary. The conditions that result in the underpricing will most likely require an updated dAPI pricing Merkle root to be published.\",\"params\":{\"dapiName\":\"dAPI name\"},\"returns\":{\"expectedSponsorWalletBalance\":\"Expected sponsor wallet balance\"}},\"computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(bytes32,bytes,uint256,uint256)\":{\"details\":\"This function is intended to be used by the API3 Market frontend to calculate how much the user should pay to purchase a specific subscription. As mentioned in the `buySubscription()` docstring, the user should aim for the sponsor wallet balance to be slightly more than the required amount in case it sends a transaction in the meantime, whose gas cost may decrease the sponsor wallet balance unexpectedly. Unit prices of the queued subscriptions are recorded on a daily basis and the expected balance is computed from these, which introduces a rounding error in the order of Weis. This also applies in practice (in that one can buy a subscription whose price is 1 ETH at 0.999... ETH). This behavior is accepted due to being trivial in effect.\",\"params\":{\"dapiName\":\"dAPI name\",\"duration\":\"Subscription duration\",\"price\":\"Subscription price\",\"updateParameters\":\"Update parameters\"},\"returns\":{\"expectedSponsorWalletBalance\":\"Expected sponsor wallet balance\"}},\"constructor\":{\"details\":\"Api3Market deploys its own AirseekerRegistry deterministically. This implies that Api3Market-specific Airseekers should be operated by pointing at this contract.\",\"params\":{\"owner_\":\"Owner address\",\"proxyFactory_\":\"ProxyFactory contract address\"}},\"containsBytecode(address)\":{\"details\":\"An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.\",\"returns\":{\"_0\":\"If the account contains bytecode\"}},\"deployDapiProxy(bytes32,bytes)\":{\"details\":\"It is recommended for the users to read data feeds through proxies deployed by ProxyFactory, rather than calling Api3ServerV1 directly. Even though proxy deployment is not a condition for purchasing subscriptions, the interface is implemented here to allow the user to purchase a dAPI subscription and deploy the respective proxy in the same transaction with a multicall.\",\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"getBalance(address)\":{\"params\":{\"account\":\"Account address\"},\"returns\":{\"_0\":\"Account balance\"}},\"getBlockBasefee()\":{\"returns\":{\"_0\":\"Current block basefee\"}},\"getBlockNumber()\":{\"returns\":{\"_0\":\"Current block number\"}},\"getBlockTimestamp()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"getChainId()\":{\"returns\":{\"_0\":\"Chain ID\"}},\"getDapiData(bytes32)\":{\"details\":\"This function is intended to be used by the API3 Market frontend to get all data related to a specific dAPI. It returns the entire subscription queue, including the items whose end timestamps are in the past.\",\"params\":{\"dapiName\":\"dAPI name\"},\"returns\":{\"beaconTimestamps\":\"Beacon timestamps read from Api3ServerV1\",\"beaconValues\":\"Beacon values read from Api3ServerV1\",\"dailyPrices\":\"Daily prices of the subscriptions in the queue\",\"dapiTimestamp\":\"dAPI timestamp read from Api3ServerV1\",\"dapiValue\":\"dAPI value read from Api3ServerV1\",\"dataFeedDetails\":\"Data feed details\",\"endTimestamps\":\"End timestamps of the subscriptions in the queue\",\"updateParameters\":\"Update parameters of the subscriptions in the queue\"}},\"getDataFeedData(bytes32)\":{\"details\":\"This function is intended to be used by the API3 Market frontend to determine what needs to be done to ready the data feed to purchase the respective subscription.\",\"params\":{\"dataFeedId\":\"Data feed ID\"},\"returns\":{\"beaconTimestamps\":\"Beacon timestamps read from Api3ServerV1\",\"beaconValues\":\"Beacon values read from Api3ServerV1\",\"dataFeedDetails\":\"Data feed details\",\"dataFeedTimestamp\":\"Data feed timestamp read from Api3ServerV1\",\"dataFeedValue\":\"Data feed value read from Api3ServerV1\"}},\"getHashValue(bytes32)\":{\"params\":{\"hashType\":\"Hash type\"},\"returns\":{\"hashValue\":\"Hash value\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"owner()\":{\"returns\":{\"_0\":\"Owner address\"}},\"registerDataFeed(bytes)\":{\"params\":{\"dataFeedDetails\":\"Data feed details\"},\"returns\":{\"dataFeedId\":\"Data feed ID\"}},\"registerHash(bytes32,bytes32,uint256,bytes[])\":{\"params\":{\"hashTimestamp\":\"Hash timestamp\",\"hashType\":\"Hash type\",\"hashValue\":\"Hash value\",\"signatures\":\"Signatures\"}},\"setHash(bytes32,bytes32)\":{\"params\":{\"hashType\":\"Hash type\",\"hashValue\":\"Hash value\"}},\"setSigners(bytes32,address[])\":{\"params\":{\"hashType\":\"Hash type\",\"signers\":\"Signer addresses\"}},\"signatureDelegationHashType()\":{\"returns\":{\"_0\":\"Signature delegation hash type\"}},\"subscriptionIdToUpdateParameters(bytes32)\":{\"params\":{\"subscriptionId\":\"Subscription ID\"},\"returns\":{\"updateParameters\":\"Update parameters\"}},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}},\"updateBeaconSetWithBeacons(bytes32[])\":{\"params\":{\"beaconIds\":\"Beacon IDs\"},\"returns\":{\"beaconSetId\":\"Updated Beacon set ID\"}},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"details\":\"The user is intended to make a multicall transaction through the API3 Market frontend to satisfy the required conditions to be able to buy a subscription and buy the subscription in a single transaction. The functions to which external calls must be made to to satisfy said conditions (such as this one) are added to this contract so that they can be multi-called by the user.\",\"params\":{\"airnode\":\"Airnode address\",\"data\":\"Update data (an `int256` encoded in contract ABI)\",\"signature\":\"Template ID, timestamp and the update data signed by the Airnode\",\"templateId\":\"Template ID\",\"timestamp\":\"Signature timestamp\"},\"returns\":{\"beaconId\":\"Updated Beacon ID\"}},\"updateCurrentSubscriptionId(bytes32)\":{\"details\":\"The fact that there is a current subscription that has ended would mean that API3 is providing a service that was not paid for. Therefore, API3 should poll this function for all active dAPI names and call it whenever it is not going to revert to downgrade the specs.\",\"params\":{\"dapiName\":\"dAPI name\"}},\"updateDapiName(bytes32,bytes32,address,bytes)\":{\"details\":\"Buying a dAPI subscription always updates the dAPI name if necessary. However, API3 may also publish new Merkle roots between subscription purchases, in which case API3 should call this function to bring the chain state up to date. Therefore, API3 should poll this function for all active dAPI names and call it whenever it will not revert. Similar to `buySubscription()`, this function requires the data feed that the dAPI will be pointed to to be readied. This function is allowed to be called even when the respective dAPI is not active, which means that a dAPI name being set does not imply that the respective data feed is in service. Users should only use dAPIs for which there is an active subscription with the update parameters that satisfy their needs.\",\"params\":{\"dapiManagementMerkleData\":\"ABI-encoded dAPI management Merkle root and proof\",\"dapiName\":\"dAPI name\",\"dataFeedId\":\"Data feed ID\",\"sponsorWallet\":\"Sponsor wallet address\"}},\"updateSignedApiUrl(address,string,bytes)\":{\"details\":\"Unlike the dAPI management and pricing Merkle leaves, the signed API URL Merkle leaves are not registered by the users as a part of subscription purchase transactions. API3 should poll this function for all Airnodes that are used in active dAPIs and call it whenever it will not revert.\",\"params\":{\"airnode\":\"Airnode address\",\"signedApiUrl\":\"Signed API URL\",\"signedApiUrlMerkleData\":\"ABI-encoded signed API URL Merkle root and proof\"}}},\"stateVariables\":{\"DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE\":{\"details\":\"\\\"Hash type\\\" is what HashRegistry uses to address hashes used for different purposes\"},\"MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH\":{\"details\":\"Some functionality in this contract requires to iterate through the entire subscription queue for a dAPI, and the queue length is limited to prevent this process from being bloated. Considering that each item in the subscription queue has unique update parameters, the length of the subscription queue is also limited by the number of unique update parameters offered in the dAPI pricing Merkle tree. For reference, at the time this contract is implemented, the API3 Market offers 4 update parameter options, and this number is not expected to be increased (i.e., we do not expect this queue length limit to be hit in practice).\"}},\"title\":\"The contract that API3 users interact with using the API3 Market frontend to purchase data feed subscriptions\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE()\":{\"notice\":\"dAPI management Merkle root hash type\"},\"DAPI_PRICING_MERKLE_ROOT_HASH_TYPE()\":{\"notice\":\"dAPI pricing Merkle root hash type\"},\"MAXIMUM_DAPI_UPDATE_AGE()\":{\"notice\":\"Maximum dAPI update age. This contract cannot be used to set a dAPI name to a data feed that has not been updated in the last `MAXIMUM_DAPI_UPDATE_AGE`.\"},\"MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH()\":{\"notice\":\"Maximum subscription queue length for a dAPI\"},\"SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE()\":{\"notice\":\"Signed API URL Merkle root hash type\"},\"airseekerRegistry()\":{\"notice\":\"AirseekerRegistry contract address\"},\"api3ServerV1()\":{\"notice\":\"Api3ServerV1 contract address\"},\"buySubscription(bytes32,bytes32,address,bytes,bytes,uint256,uint256,bytes)\":{\"notice\":\"Buys subscription and updates the current subscription ID if necessary. The user is recommended to interact with this contract only over the API3 Market frontend due to its complexity.\"},\"computeExpectedSponsorWalletBalance(bytes32)\":{\"notice\":\"Computes the expected sponsor wallet balance based on the current subscription queue\"},\"computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(bytes32,bytes,uint256,uint256)\":{\"notice\":\"Computes the expected sponsor wallet balance after the respective subscription is added to the queue\"},\"containsBytecode(address)\":{\"notice\":\"Returns if the account contains bytecode\"},\"dapiNameToCurrentSubscriptionId(bytes32)\":{\"notice\":\"dAPI name to current subscription ID, which denotes the start of the subscription queue for the dAPI\"},\"deployDapiProxy(bytes32,bytes)\":{\"notice\":\"Calls ProxyFactory to deterministically deploy the dAPI proxy\"},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"notice\":\"Calls ProxyFactory to deterministically deploy the dAPI proxy with OEV support\"},\"getBalance(address)\":{\"notice\":\"Returns the account balance\"},\"getBlockBasefee()\":{\"notice\":\"Returns the current block basefee\"},\"getBlockNumber()\":{\"notice\":\"Returns the current block number\"},\"getBlockTimestamp()\":{\"notice\":\"Returns the current block timestamp\"},\"getChainId()\":{\"notice\":\"Returns the chain ID\"},\"getDapiData(bytes32)\":{\"notice\":\"Gets all data about the dAPI that is available\"},\"getDataFeedData(bytes32)\":{\"notice\":\"Gets all data about the data feed that is available\"},\"getHashValue(bytes32)\":{\"notice\":\"Returns get the hash value for the type\"},\"hashTypeToSignersHash(bytes32)\":{\"notice\":\"Hash type to the hash of the array of signer addresses\"},\"hashes(bytes32)\":{\"notice\":\"Hash type to the last registered value and timestamp\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"owner()\":{\"notice\":\"Returns the owner address\"},\"proxyFactory()\":{\"notice\":\"ProxyFactory contract address\"},\"registerDataFeed(bytes)\":{\"notice\":\"Calls AirseekerRegistry to register the data feed\"},\"registerHash(bytes32,bytes32,uint256,bytes[])\":{\"notice\":\"Registers the hash value and timestamp for the respective type. The hash value cannot be zero. The timestamp must not exceed the block timestamp, yet be larger than the timestamp of the previous registration. The signers must have been set for the hash type, and the signatures must be sorted for the respective signer addresses to be in ascending order. Each signature can either be a standalone signature by the respective signer, or a signature by the signer's delegate, encoded along with the delegation end timestamp and delegation signature.\"},\"renounceOwnership()\":{\"notice\":\"Overriden to be disabled\"},\"setHash(bytes32,bytes32)\":{\"notice\":\"Called by the owner to set a hash. Overrides previous registrations and is allowed to set the value to `bytes32(0)`.\"},\"setSigners(bytes32,address[])\":{\"notice\":\"Called by the contract owner to set signers for a hash type. The signer addresses must be in ascending order.\"},\"signatureDelegationHashType()\":{\"notice\":\"Returns the signature delegation hash type used in delegation signatures\"},\"subscriptionIdToUpdateParameters(bytes32)\":{\"notice\":\"Subscription ID to update parameters\"},\"subscriptions(bytes32)\":{\"notice\":\"Subscriptions indexed by their IDs\"},\"transferOwnership(address)\":{\"notice\":\"Overriden to be disabled\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateBeaconSetWithBeacons(bytes32[])\":{\"notice\":\"Calls Api3ServerV1 to update the Beacon set using the current values of its Beacons\"},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"notice\":\"Calls Api3ServerV1 to update the Beacon using data signed by the Airnode\"},\"updateCurrentSubscriptionId(bytes32)\":{\"notice\":\"If the current subscription has ended, updates it with the one that will end next\"},\"updateDapiName(bytes32,bytes32,address,bytes)\":{\"notice\":\"Updates the dAPI name to match the respective Merkle leaf\"},\"updateSignedApiUrl(address,string,bytes)\":{\"notice\":\"Updates the signed API URL of the Airnode to match the respective Merkle leaf\"}},\"notice\":\"API3 aims to streamline and protocolize its integration processes through the API3 Market (https://market.api3.org), which is a data feed subscription marketplace. The Api3Market contract is the on-chain portion of this system. Api3Market enables API3 to predetermine the decisions related to its data feed services (such as the curation of data feed sources or subscription prices) and publish them on-chain. This streamlines the intergation flow, as it allows the users to initiate subscriptions immediately, without requiring any two-way communication with API3. Furthermore, this removes the need for API3 to have agents operating in the meatspace gathering order details, quoting prices and reviewing payments, and allows all such operations to be cryptographically secured with a multi-party scheme in an end-to-end manner.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/api3-server-v1/Api3Market.sol\":\"Api3Market\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/access/HashRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol\\\";\\nimport \\\"./interfaces/IHashRegistry.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title A contract where a value for each hash type can be registered using\\n/// the signatures of the respective signers that are set by the contract owner\\n/// @notice Hashes are identified by a unique \\\"hash type\\\", which is a `bytes32`\\n/// type that can be determined based on any arbitrary convention. The contract\\n/// owner can set a list of signers for each hash type. For a hash value to be\\n/// registered, its signers must be set by the contract owner, and valid\\n/// signatures by each signer must be provided. The hash values are bundled\\n/// with timestamps that act as nonces, meaning that each registration must\\n/// be with a larger timestamp than the previous. The contract owner can\\n/// override previously registered hashes.\\n/// A signer can sign a delegation message that allows the delegate to sign\\n/// hashes on their behalf across all instances of this contract until the\\n/// specified time. This delegation is irrevocable by design (as revoking across\\n/// all instances would be error-prone). To undo an unwanted delegation, the\\n/// signer must be swapped out by the contract owner until the delegation runs\\n/// out.\\n/// @dev This contract can be used in standalone form to be referred to through\\n/// external calls, or inherited by the contract that will access the\\n/// registered hashes internally.\\n/// HashRegistry is intended for use-cases where signatures and delegations\\n/// need to apply universally across domains, which is why it is blind to the\\n/// domain (unlike ERC-712). However, the inheriting contract can implement the\\n/// type hashes to be domain-specific.\\ncontract HashRegistry is Ownable, IHashRegistry {\\n struct Hash {\\n bytes32 value;\\n uint256 timestamp;\\n }\\n\\n /// @notice Hash type to the last registered value and timestamp\\n mapping(bytes32 => Hash) public override hashes;\\n\\n /// @notice Hash type to the hash of the array of signer addresses\\n mapping(bytes32 => bytes32) public override hashTypeToSignersHash;\\n\\n uint256 private constant ECDSA_SIGNATURE_LENGTH = 65;\\n\\n // Length of abi.encode(uint256, bytes, bytes), where the bytes types are\\n // ECDSA signatures padded to the next largest multiple of 32 bytes, which\\n // is 96\\n uint256 private constant DELEGATED_SIGNATURE_LENGTH =\\n 32 + 32 + 32 + (32 + 96) + (32 + 96);\\n\\n /// @param owner_ Owner address\\n constructor(address owner_) {\\n require(owner_ != address(0), \\\"Owner address zero\\\");\\n _transferOwnership(owner_);\\n }\\n\\n /// @notice Returns the owner address\\n /// @return Owner address\\n function owner()\\n public\\n view\\n virtual\\n override(Ownable, IOwnable)\\n returns (address)\\n {\\n return super.owner();\\n }\\n\\n /// @notice Called by the owner to renounce the ownership of the contract\\n function renounceOwnership() public virtual override(Ownable, IOwnable) {\\n return super.renounceOwnership();\\n }\\n\\n /// @notice Called by the owner to transfer the ownership of the contract\\n /// @param newOwner New owner address\\n function transferOwnership(\\n address newOwner\\n ) public virtual override(Ownable, IOwnable) {\\n return super.transferOwnership(newOwner);\\n }\\n\\n /// @notice Called by the contract owner to set signers for a hash type.\\n /// The signer addresses must be in ascending order.\\n /// @param hashType Hash type\\n /// @param signers Signer addresses\\n function setSigners(\\n bytes32 hashType,\\n address[] calldata signers\\n ) external override onlyOwner {\\n require(hashType != bytes32(0), \\\"Hash type zero\\\");\\n uint256 signersCount = signers.length;\\n require(signersCount != 0, \\\"Signers empty\\\");\\n require(signers[0] != address(0), \\\"First signer address zero\\\");\\n for (uint256 ind = 1; ind < signersCount; ind++) {\\n require(\\n signers[ind] > signers[ind - 1],\\n \\\"Signers not in ascending order\\\"\\n );\\n }\\n hashTypeToSignersHash[hashType] = keccak256(abi.encodePacked(signers));\\n emit SetSigners(hashType, signers);\\n }\\n\\n /// @notice Called by the owner to set a hash. Overrides previous\\n /// registrations and is allowed to set the value to `bytes32(0)`.\\n /// @param hashType Hash type\\n /// @param hashValue Hash value\\n function setHash(\\n bytes32 hashType,\\n bytes32 hashValue\\n ) external override onlyOwner {\\n hashes[hashType] = Hash({value: hashValue, timestamp: block.timestamp});\\n emit SetHash(hashType, hashValue, block.timestamp);\\n }\\n\\n /// @notice Registers the hash value and timestamp for the respective type.\\n /// The hash value cannot be zero.\\n /// The timestamp must not exceed the block timestamp, yet be larger than\\n /// the timestamp of the previous registration.\\n /// The signers must have been set for the hash type, and the signatures\\n /// must be sorted for the respective signer addresses to be in ascending\\n /// order.\\n /// Each signature can either be a standalone signature by the respective\\n /// signer, or a signature by the signer's delegate, encoded along with\\n /// the delegation end timestamp and delegation signature.\\n /// @param hashType Hash type\\n /// @param hashValue Hash value\\n /// @param hashTimestamp Hash timestamp\\n /// @param signatures Signatures\\n function registerHash(\\n bytes32 hashType,\\n bytes32 hashValue,\\n uint256 hashTimestamp,\\n bytes[] calldata signatures\\n ) external override {\\n require(hashValue != bytes32(0), \\\"Hash value zero\\\");\\n require(hashTimestamp <= block.timestamp, \\\"Hash timestamp from future\\\");\\n require(\\n hashTimestamp > hashes[hashType].timestamp,\\n \\\"Hash timestamp not more recent\\\"\\n );\\n bytes32 signersHash = hashTypeToSignersHash[hashType];\\n require(signersHash != bytes32(0), \\\"Signers not set\\\");\\n uint256 signaturesCount = signatures.length;\\n address[] memory signers = new address[](signaturesCount);\\n bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(\\n keccak256(abi.encodePacked(hashType, hashValue, hashTimestamp))\\n );\\n for (uint256 ind = 0; ind < signaturesCount; ind++) {\\n uint256 signatureLength = signatures[ind].length;\\n if (signatureLength == ECDSA_SIGNATURE_LENGTH) {\\n signers[ind] = ECDSA.recover(\\n ethSignedMessageHash,\\n signatures[ind]\\n );\\n } else if (signatureLength == DELEGATED_SIGNATURE_LENGTH) {\\n (\\n uint256 delegationEndTimestamp,\\n bytes memory delegationSignature,\\n bytes memory hashSignature\\n ) = abi.decode(signatures[ind], (uint256, bytes, bytes));\\n require(\\n block.timestamp < delegationEndTimestamp,\\n \\\"Delegation ended\\\"\\n );\\n signers[ind] = ECDSA.recover(\\n ECDSA.toEthSignedMessageHash(\\n keccak256(\\n abi.encodePacked(\\n signatureDelegationHashType(),\\n ECDSA.recover(\\n ethSignedMessageHash,\\n hashSignature\\n ),\\n delegationEndTimestamp\\n )\\n )\\n ),\\n delegationSignature\\n );\\n } else {\\n revert(\\\"Invalid signature length\\\");\\n }\\n }\\n require(\\n signersHash == keccak256(abi.encodePacked(signers)),\\n \\\"Signature mismatch\\\"\\n );\\n hashes[hashType] = Hash({value: hashValue, timestamp: hashTimestamp});\\n emit RegisteredHash(hashType, hashValue, hashTimestamp);\\n }\\n\\n /// @notice Returns the signature delegation hash type used in delegation\\n /// signatures\\n /// @dev Delegation signatures signed with a signature delegation hash type\\n /// will apply universally across all HashRegistry instances that use that\\n /// same signature delegation hash type. The inheriting contract can\\n /// specify a special signature delegation hash type by overriding this\\n /// function.\\n /// @return Signature delegation hash type\\n function signatureDelegationHashType()\\n public\\n view\\n virtual\\n override\\n returns (bytes32)\\n {\\n return keccak256(abi.encodePacked(\\\"HashRegistry signature delegation\\\"));\\n }\\n\\n /// @notice Returns get the hash value for the type\\n /// @param hashType Hash type\\n /// @return hashValue Hash value\\n function getHashValue(\\n bytes32 hashType\\n ) external view override returns (bytes32 hashValue) {\\n hashValue = hashes[hashType].value;\\n }\\n}\\n\",\"keccak256\":\"0xca85497e04f8fc58edc0b5402ddcf118fa8bb94f85180fbc677409725028363e\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/access/interfaces/IHashRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOwnable.sol\\\";\\n\\ninterface IHashRegistry is IOwnable {\\n event SetSigners(bytes32 indexed hashType, address[] signers);\\n\\n event SetHash(\\n bytes32 indexed hashType,\\n bytes32 hashValue,\\n uint256 hashTimestamp\\n );\\n\\n event RegisteredHash(\\n bytes32 indexed hashType,\\n bytes32 hashValue,\\n uint256 hashTimestamp\\n );\\n\\n function setSigners(bytes32 hashType, address[] calldata signers) external;\\n\\n function setHash(bytes32 hashType, bytes32 hashValue) external;\\n\\n function registerHash(\\n bytes32 hashType,\\n bytes32 hashValue,\\n uint256 hashTimestamp,\\n bytes[] calldata signatures\\n ) external;\\n\\n function signatureDelegationHashType() external view returns (bytes32);\\n\\n function getHashValue(\\n bytes32 hashType\\n ) external view returns (bytes32 hashValue);\\n\\n function hashes(\\n bytes32 hashType\\n ) external view returns (bytes32 hashValue, uint256 hashTimestamp);\\n\\n function hashTypeToSignersHash(\\n bytes32 hashType\\n ) external view returns (bytes32 signersHash);\\n}\\n\",\"keccak256\":\"0x07bf00948add53f8b96929f13a4ce6227c954c886c7c9c809e4eefc7644147ab\",\"license\":\"MIT\"},\"contracts/access/interfaces/IOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOwnable {\\n function owner() external view returns (address);\\n\\n function renounceOwnership() external;\\n\\n function transferOwnership(address newOwner) external;\\n}\\n\",\"keccak256\":\"0x7fdae1b6079bd51604f096a075a9abf4eacba5d332319b38cbeb1cca0c1745f6\",\"license\":\"MIT\"},\"contracts/api3-server-v1/AirseekerRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol\\\";\\nimport \\\"../utils/ExtendedSelfMulticall.sol\\\";\\nimport \\\"./interfaces/IAirseekerRegistry.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title A contract where active data feeds and their specs are registered by\\n/// the contract owner for the Airseeker that serves them to refer to\\n/// @notice Airseeker is an application that pushes API provider-signed data to\\n/// chain when certain conditions are met so that the data feeds served on the\\n/// Api3ServerV1 contract are updated according to the respective specs. In\\n/// other words, this contract is an on-chain configuration file for an\\n/// Airseeker (or multiple Airseekers in a setup with redundancy).\\n/// The Airseeker must know which data feeds are active (and thus need to be\\n/// updated), the constituting Airnode (the oracle node that API providers\\n/// operate to sign data) addresses and request template IDs, what the\\n/// respective on-chain data feed values are, what the update parameters are,\\n/// and the URL of the signed APIs (from which Airseeker can fetch signed data)\\n/// that are hosted by the respective API providers.\\n/// The contract owner is responsible with leaving the state of this contract\\n/// in a way that Airseeker expects. For example, if a dAPI name is activated\\n/// without registering the respective data feed, the Airseeker will not have\\n/// access to the data that it needs to execute updates.\\ncontract AirseekerRegistry is\\n Ownable,\\n ExtendedSelfMulticall,\\n IAirseekerRegistry\\n{\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n\\n /// @notice Maximum number of Beacons in a Beacon set that can be\\n /// registered\\n /// @dev Api3ServerV1 introduces the concept of a Beacon, which is a\\n /// single-source data feed. Api3ServerV1 allows Beacons to be read\\n /// individually, or arbitrary combinations of them to be aggregated\\n /// on-chain to form multiple-source data feeds, which are called Beacon\\n /// sets. This contract does not support Beacon sets that consist of more\\n /// than `MAXIMUM_BEACON_COUNT_IN_SET` Beacons to be registered.\\n uint256 public constant override MAXIMUM_BEACON_COUNT_IN_SET = 21;\\n\\n /// @notice Maximum encoded update parameters length\\n uint256 public constant override MAXIMUM_UPDATE_PARAMETERS_LENGTH = 1024;\\n\\n /// @notice Maximum signed API URL length\\n uint256 public constant override MAXIMUM_SIGNED_API_URL_LENGTH = 256;\\n\\n /// @notice Api3ServerV1 contract address\\n address public immutable override api3ServerV1;\\n\\n /// @notice Airnode address to signed API URL\\n /// @dev An Airseeker can be configured to refer to additional signed APIs\\n /// than the ones whose URLs are stored in this contract for redundancy\\n mapping(address => string) public override airnodeToSignedApiUrl;\\n\\n /// @notice Data feed ID to encoded details\\n mapping(bytes32 => bytes) public override dataFeedIdToDetails;\\n\\n // Api3ServerV1 uses Beacon IDs (see the `deriveBeaconId()` implementation)\\n // and Beacon set IDs (see the `deriveBeaconSetId()` implementation) to\\n // address data feeds. We use data feed ID as a general term to refer to a\\n // Beacon ID/Beacon set ID.\\n // A data feed ID is immutable (i.e., it always points to the same Beacon\\n // or Beacon set). Api3ServerV1 allows a dAPI name to be pointed to a data\\n // feed ID by privileged accounts to implement a mutable data feed\\n // addressing scheme.\\n // If the data feed ID or dAPI name should be used to read a data feed\\n // depends on the use case. To support both schemes, AirseekerRegistry\\n // allows data feeds specs to be defined with either the data feed ID or\\n // the dAPI name.\\n EnumerableSet.Bytes32Set private activeDataFeedIds;\\n\\n EnumerableSet.Bytes32Set private activeDapiNames;\\n\\n // Considering that the update parameters are typically reused between data\\n // feeds, a hash map is used to avoid storing the same update parameters\\n // redundantly\\n mapping(bytes32 => bytes32) private dataFeedIdToUpdateParametersHash;\\n\\n mapping(bytes32 => bytes32) private dapiNameToUpdateParametersHash;\\n\\n mapping(bytes32 => bytes) private updateParametersHashToValue;\\n\\n // Length of abi.encode(address, bytes32)\\n uint256 private constant DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON =\\n 32 + 32;\\n\\n // Length of abi.encode(address[2], bytes32[2])\\n uint256\\n private constant DATA_FEED_DETAILS_LENGTH_FOR_BEACON_SET_WITH_TWO_BEACONS =\\n 32 + 32 + (32 + 2 * 32) + (32 + 2 * 32);\\n\\n // Length of\\n // abi.encode(address[MAXIMUM_BEACON_COUNT_IN_SET], bytes32[MAXIMUM_BEACON_COUNT_IN_SET])\\n uint256 private constant MAXIMUM_DATA_FEED_DETAILS_LENGTH =\\n 32 +\\n 32 +\\n (32 + MAXIMUM_BEACON_COUNT_IN_SET * 32) +\\n (32 + MAXIMUM_BEACON_COUNT_IN_SET * 32);\\n\\n /// @dev Reverts if the data feed ID is zero\\n /// @param dataFeedId Data feed ID\\n modifier onlyNonZeroDataFeedId(bytes32 dataFeedId) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n _;\\n }\\n\\n /// @dev Reverts if the dAPI name is zero\\n /// @param dapiName dAPI name\\n modifier onlyNonZeroDapiName(bytes32 dapiName) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n _;\\n }\\n\\n /// @dev Reverts if the update parameters are too long\\n /// @param updateParameters Update parameters\\n modifier onlyValidUpdateParameters(bytes calldata updateParameters) {\\n require(\\n updateParameters.length <= MAXIMUM_UPDATE_PARAMETERS_LENGTH,\\n \\\"Update parameters too long\\\"\\n );\\n _;\\n }\\n\\n /// @param owner_ Owner address\\n /// @param api3ServerV1_ Api3ServerV1 contract address\\n constructor(address owner_, address api3ServerV1_) {\\n require(owner_ != address(0), \\\"Owner address zero\\\");\\n require(api3ServerV1_ != address(0), \\\"Api3ServerV1 address zero\\\");\\n _transferOwnership(owner_);\\n api3ServerV1 = api3ServerV1_;\\n }\\n\\n /// @notice Returns the owner address\\n /// @return Owner address\\n function owner() public view override(Ownable, IOwnable) returns (address) {\\n return super.owner();\\n }\\n\\n /// @notice Overriden to be disabled\\n function renounceOwnership() public pure override(Ownable, IOwnable) {\\n revert(\\\"Ownership cannot be renounced\\\");\\n }\\n\\n /// @notice Overriden to be disabled\\n function transferOwnership(\\n address\\n ) public pure override(Ownable, IOwnable) {\\n revert(\\\"Ownership cannot be transferred\\\");\\n }\\n\\n /// @notice Called by the owner to set the data feed ID to be activated\\n /// @param dataFeedId Data feed ID\\n function setDataFeedIdToBeActivated(\\n bytes32 dataFeedId\\n ) external override onlyOwner onlyNonZeroDataFeedId(dataFeedId) {\\n if (activeDataFeedIds.add(dataFeedId)) {\\n emit ActivatedDataFeedId(dataFeedId);\\n }\\n }\\n\\n /// @notice Called by the owner to set the dAPI name to be activated\\n /// @param dapiName dAPI name\\n function setDapiNameToBeActivated(\\n bytes32 dapiName\\n ) external override onlyOwner onlyNonZeroDapiName(dapiName) {\\n if (activeDapiNames.add(dapiName)) {\\n emit ActivatedDapiName(dapiName);\\n }\\n }\\n\\n /// @notice Called by the owner to set the data feed ID to be deactivated\\n /// @param dataFeedId Data feed ID\\n function setDataFeedIdToBeDeactivated(\\n bytes32 dataFeedId\\n ) external override onlyOwner onlyNonZeroDataFeedId(dataFeedId) {\\n if (activeDataFeedIds.remove(dataFeedId)) {\\n emit DeactivatedDataFeedId(dataFeedId);\\n }\\n }\\n\\n /// @notice Called by the owner to set the dAPI name to be deactivated\\n /// @param dapiName dAPI name\\n function setDapiNameToBeDeactivated(\\n bytes32 dapiName\\n ) external override onlyOwner onlyNonZeroDapiName(dapiName) {\\n if (activeDapiNames.remove(dapiName)) {\\n emit DeactivatedDapiName(dapiName);\\n }\\n }\\n\\n /// @notice Called by the owner to set the data feed ID update parameters.\\n /// The update parameters must be encoded in a format that Airseeker\\n /// expects.\\n /// @param dataFeedId Data feed ID\\n /// @param updateParameters Update parameters\\n function setDataFeedIdUpdateParameters(\\n bytes32 dataFeedId,\\n bytes calldata updateParameters\\n )\\n external\\n override\\n onlyOwner\\n onlyNonZeroDataFeedId(dataFeedId)\\n onlyValidUpdateParameters(updateParameters)\\n {\\n bytes32 updateParametersHash = keccak256(updateParameters);\\n if (\\n dataFeedIdToUpdateParametersHash[dataFeedId] != updateParametersHash\\n ) {\\n dataFeedIdToUpdateParametersHash[dataFeedId] = updateParametersHash;\\n if (\\n updateParametersHashToValue[updateParametersHash].length !=\\n updateParameters.length\\n ) {\\n updateParametersHashToValue[\\n updateParametersHash\\n ] = updateParameters;\\n }\\n emit UpdatedDataFeedIdUpdateParameters(\\n dataFeedId,\\n updateParameters\\n );\\n }\\n }\\n\\n /// @notice Called by the owner to set the dAPI name update parameters.\\n /// The update parameters must be encoded in a format that Airseeker\\n /// expects.\\n /// @param dapiName dAPI name\\n /// @param updateParameters Update parameters\\n function setDapiNameUpdateParameters(\\n bytes32 dapiName,\\n bytes calldata updateParameters\\n )\\n external\\n override\\n onlyOwner\\n onlyNonZeroDapiName(dapiName)\\n onlyValidUpdateParameters(updateParameters)\\n {\\n bytes32 updateParametersHash = keccak256(updateParameters);\\n if (dapiNameToUpdateParametersHash[dapiName] != updateParametersHash) {\\n dapiNameToUpdateParametersHash[dapiName] = updateParametersHash;\\n if (\\n updateParametersHashToValue[updateParametersHash].length !=\\n updateParameters.length\\n ) {\\n updateParametersHashToValue[\\n updateParametersHash\\n ] = updateParameters;\\n }\\n emit UpdatedDapiNameUpdateParameters(dapiName, updateParameters);\\n }\\n }\\n\\n /// @notice Called by the owner to set the signed API URL for the Airnode.\\n /// The signed API must implement the specific interface that Airseeker\\n /// expects.\\n /// @param airnode Airnode address\\n /// @param signedApiUrl Signed API URL\\n function setSignedApiUrl(\\n address airnode,\\n string calldata signedApiUrl\\n ) external override onlyOwner {\\n require(airnode != address(0), \\\"Airnode address zero\\\");\\n require(\\n abi.encodePacked(signedApiUrl).length <=\\n MAXIMUM_SIGNED_API_URL_LENGTH,\\n \\\"Signed API URL too long\\\"\\n );\\n if (\\n keccak256(abi.encodePacked(airnodeToSignedApiUrl[airnode])) !=\\n keccak256(abi.encodePacked(signedApiUrl))\\n ) {\\n airnodeToSignedApiUrl[airnode] = signedApiUrl;\\n emit UpdatedSignedApiUrl(airnode, signedApiUrl);\\n }\\n }\\n\\n /// @notice Registers the data feed. In the case that the data feed is a\\n /// Beacon, the details should be the ABI-encoded Airnode address and\\n /// template ID. In the case that the data feed is a Beacon set, the\\n /// details should be the ABI-encoded Airnode addresses array and template\\n /// IDs array.\\n /// @param dataFeedDetails Data feed details\\n /// @return dataFeedId Data feed ID\\n function registerDataFeed(\\n bytes calldata dataFeedDetails\\n ) external override returns (bytes32 dataFeedId) {\\n uint256 dataFeedDetailsLength = dataFeedDetails.length;\\n if (\\n dataFeedDetailsLength == DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\\n ) {\\n // dataFeedId maps to a Beacon\\n (address airnode, bytes32 templateId) = abi.decode(\\n dataFeedDetails,\\n (address, bytes32)\\n );\\n require(airnode != address(0), \\\"Airnode address zero\\\");\\n dataFeedId = deriveBeaconId(airnode, templateId);\\n } else if (\\n dataFeedDetailsLength >=\\n DATA_FEED_DETAILS_LENGTH_FOR_BEACON_SET_WITH_TWO_BEACONS\\n ) {\\n require(\\n dataFeedDetailsLength <= MAXIMUM_DATA_FEED_DETAILS_LENGTH,\\n \\\"Data feed details too long\\\"\\n );\\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\\n .decode(dataFeedDetails, (address[], bytes32[]));\\n require(\\n abi.encode(airnodes, templateIds).length ==\\n dataFeedDetailsLength,\\n \\\"Data feed details trail\\\"\\n );\\n uint256 beaconCount = airnodes.length;\\n require(\\n beaconCount == templateIds.length,\\n \\\"Parameter length mismatch\\\"\\n );\\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\\n for (uint256 ind = 0; ind < beaconCount; ind++) {\\n require(airnodes[ind] != address(0), \\\"Airnode address zero\\\");\\n beaconIds[ind] = deriveBeaconId(\\n airnodes[ind],\\n templateIds[ind]\\n );\\n }\\n dataFeedId = deriveBeaconSetId(beaconIds);\\n } else {\\n revert(\\\"Data feed details too short\\\");\\n }\\n if (dataFeedIdToDetails[dataFeedId].length != dataFeedDetailsLength) {\\n dataFeedIdToDetails[dataFeedId] = dataFeedDetails;\\n emit RegisteredDataFeed(dataFeedId, dataFeedDetails);\\n }\\n }\\n\\n /// @notice In an imaginary array consisting of the the active data feed\\n /// IDs and active dAPI names, picks the index-th identifier, and returns\\n /// all data about the respective data feed that is available. Whenever\\n /// data is not available (including the case where index does not\\n /// correspond to an active data feed), returns empty values.\\n /// @dev Airseeker uses this function to get all the data it needs about an\\n /// active data feed with a single RPC call\\n /// @param index Index\\n /// @return dataFeedId Data feed ID\\n /// @return dapiName dAPI name (`bytes32(0)` if the active data feed is\\n /// identified by a data feed ID)\\n /// @return dataFeedDetails Data feed details\\n /// @return dataFeedValue Data feed value read from Api3ServerV1\\n /// @return dataFeedTimestamp Data feed timestamp read from Api3ServerV1\\n /// @return beaconValues Beacon values read from Api3ServerV1\\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\\n /// @return updateParameters Update parameters\\n /// @return signedApiUrls Signed API URLs of the Beacon Airnodes\\n function activeDataFeed(\\n uint256 index\\n )\\n external\\n view\\n override\\n returns (\\n bytes32 dataFeedId,\\n bytes32 dapiName,\\n bytes memory dataFeedDetails,\\n int224 dataFeedValue,\\n uint32 dataFeedTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps,\\n bytes memory updateParameters,\\n string[] memory signedApiUrls\\n )\\n {\\n uint256 activeDataFeedIdsLength = activeDataFeedIdCount();\\n if (index < activeDataFeedIdsLength) {\\n dataFeedId = activeDataFeedIds.at(index);\\n updateParameters = dataFeedIdToUpdateParameters(dataFeedId);\\n } else if (index < activeDataFeedIdsLength + activeDapiNames.length()) {\\n dapiName = activeDapiNames.at(index - activeDataFeedIdsLength);\\n dataFeedId = IApi3ServerV1(api3ServerV1).dapiNameHashToDataFeedId(\\n keccak256(abi.encodePacked(dapiName))\\n );\\n updateParameters = dapiNameToUpdateParameters(dapiName);\\n }\\n if (dataFeedId != bytes32(0)) {\\n dataFeedDetails = dataFeedIdToDetails[dataFeedId];\\n (dataFeedValue, dataFeedTimestamp) = IApi3ServerV1(api3ServerV1)\\n .dataFeeds(dataFeedId);\\n }\\n if (dataFeedDetails.length != 0) {\\n if (\\n dataFeedDetails.length ==\\n DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\\n ) {\\n beaconValues = new int224[](1);\\n beaconTimestamps = new uint32[](1);\\n signedApiUrls = new string[](1);\\n (address airnode, bytes32 templateId) = abi.decode(\\n dataFeedDetails,\\n (address, bytes32)\\n );\\n (beaconValues[0], beaconTimestamps[0]) = IApi3ServerV1(\\n api3ServerV1\\n ).dataFeeds(deriveBeaconId(airnode, templateId));\\n signedApiUrls[0] = airnodeToSignedApiUrl[airnode];\\n } else {\\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\\n .decode(dataFeedDetails, (address[], bytes32[]));\\n uint256 beaconCount = airnodes.length;\\n beaconValues = new int224[](beaconCount);\\n beaconTimestamps = new uint32[](beaconCount);\\n signedApiUrls = new string[](beaconCount);\\n for (uint256 ind = 0; ind < beaconCount; ind++) {\\n (beaconValues[ind], beaconTimestamps[ind]) = IApi3ServerV1(\\n api3ServerV1\\n ).dataFeeds(\\n deriveBeaconId(airnodes[ind], templateIds[ind])\\n );\\n signedApiUrls[ind] = airnodeToSignedApiUrl[airnodes[ind]];\\n }\\n }\\n }\\n }\\n\\n /// @notice Returns the number of active data feeds identified by a data\\n /// feed ID or dAPI name\\n /// @return Active data feed count\\n function activeDataFeedCount() external view override returns (uint256) {\\n return activeDataFeedIdCount() + activeDapiNameCount();\\n }\\n\\n /// @notice Returns the number of active data feeds identified by a data\\n /// feed ID\\n /// @return Active data feed ID count\\n function activeDataFeedIdCount() public view override returns (uint256) {\\n return activeDataFeedIds.length();\\n }\\n\\n /// @notice Returns the number of active data feeds identified by a dAPI\\n /// name\\n /// @return Active dAPI name count\\n function activeDapiNameCount() public view override returns (uint256) {\\n return activeDapiNames.length();\\n }\\n\\n /// @notice Data feed ID to update parameters\\n /// @param dataFeedId Data feed ID\\n /// @return updateParameters Update parameters\\n function dataFeedIdToUpdateParameters(\\n bytes32 dataFeedId\\n ) public view override returns (bytes memory updateParameters) {\\n updateParameters = updateParametersHashToValue[\\n dataFeedIdToUpdateParametersHash[dataFeedId]\\n ];\\n }\\n\\n /// @notice dAPI name to update parameters\\n /// @param dapiName dAPI name\\n /// @return updateParameters Update parameters\\n function dapiNameToUpdateParameters(\\n bytes32 dapiName\\n ) public view override returns (bytes memory updateParameters) {\\n updateParameters = updateParametersHashToValue[\\n dapiNameToUpdateParametersHash[dapiName]\\n ];\\n }\\n\\n /// @notice Returns if the data feed with ID is registered\\n /// @param dataFeedId Data feed ID\\n /// @return If the data feed with ID is registered\\n function dataFeedIsRegistered(\\n bytes32 dataFeedId\\n ) external view override returns (bool) {\\n return dataFeedIdToDetails[dataFeedId].length != 0;\\n }\\n\\n /// @notice Derives the Beacon ID from the Airnode address and template ID\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @return beaconId Beacon ID\\n function deriveBeaconId(\\n address airnode,\\n bytes32 templateId\\n ) private pure returns (bytes32 beaconId) {\\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\\n }\\n\\n /// @notice Derives the Beacon set ID from the Beacon IDs\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Beacon set ID\\n function deriveBeaconSetId(\\n bytes32[] memory beaconIds\\n ) private pure returns (bytes32 beaconSetId) {\\n beaconSetId = keccak256(abi.encode(beaconIds));\\n }\\n}\\n\",\"keccak256\":\"0x4f93e3f9bfa5183063bb7ae44f7b7178e7cf06fc255247538225e578532b3ae9\",\"license\":\"MIT\"},\"contracts/api3-server-v1/Api3Market.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access/HashRegistry.sol\\\";\\nimport \\\"../utils/ExtendedSelfMulticall.sol\\\";\\nimport \\\"./interfaces/IApi3Market.sol\\\";\\nimport \\\"./AirseekerRegistry.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/utils/math/SafeCast.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/MerkleProof.sol\\\";\\nimport \\\"./interfaces/IApi3ServerV1.sol\\\";\\nimport \\\"./proxies/interfaces/IProxyFactory.sol\\\";\\n\\n/// @title The contract that API3 users interact with using the API3 Market\\n/// frontend to purchase data feed subscriptions\\n/// @notice API3 aims to streamline and protocolize its integration processes\\n/// through the API3 Market (https://market.api3.org), which is a data feed\\n/// subscription marketplace. The Api3Market contract is the on-chain portion\\n/// of this system.\\n/// Api3Market enables API3 to predetermine the decisions related to its data\\n/// feed services (such as the curation of data feed sources or subscription\\n/// prices) and publish them on-chain. This streamlines the intergation flow,\\n/// as it allows the users to initiate subscriptions immediately, without\\n/// requiring any two-way communication with API3. Furthermore, this removes\\n/// the need for API3 to have agents operating in the meatspace gathering order\\n/// details, quoting prices and reviewing payments, and allows all such\\n/// operations to be cryptographically secured with a multi-party scheme in an\\n/// end-to-end manner.\\n/// @dev The user is strongly recommended to use the API3 Market frontend while\\n/// interacting with this contract, mostly because doing so successfully\\n/// requires some amount of knowledge of other API3 contracts. Specifically,\\n/// Api3Market requires the data feed for which the subscription is being\\n/// purchased to be \\\"readied\\\", the correct Merkle proofs to be provided, and\\n/// enough payment to be made. The API3 Market frontend will fetch the\\n/// appropriate Merkle proofs, create a multicall transaction that will ready\\n/// the data feed before making the call to buy the subscription, and compute\\n/// the amount to be sent that will barely allow the subscription to be\\n/// purchased. For most users, building such a transaction themselves would be\\n/// too impractical.\\ncontract Api3Market is HashRegistry, ExtendedSelfMulticall, IApi3Market {\\n enum UpdateParametersComparisonResult {\\n EqualToQueued,\\n BetterThanQueued,\\n WorseThanQueued\\n }\\n\\n // The update parameters for each subscription is kept in a hash map rather\\n // than in full form as an optimization. Refer to AirseekerRegistry for a\\n // similar scheme.\\n // The subscription queues are kept as linked lists, for which each\\n // subscription has a next subscription ID field.\\n struct Subscription {\\n bytes32 updateParametersHash;\\n uint32 endTimestamp;\\n uint224 dailyPrice;\\n bytes32 nextSubscriptionId;\\n }\\n\\n /// @notice Maximum subscription queue length for a dAPI\\n /// @dev Some functionality in this contract requires to iterate through\\n /// the entire subscription queue for a dAPI, and the queue length is\\n /// limited to prevent this process from being bloated. Considering that\\n /// each item in the subscription queue has unique update parameters, the\\n /// length of the subscription queue is also limited by the number of\\n /// unique update parameters offered in the dAPI pricing Merkle tree. For\\n /// reference, at the time this contract is implemented, the API3 Market\\n /// offers 4 update parameter options, and this number is not expected to\\n /// be increased (i.e., we do not expect this queue length limit to be hit\\n /// in practice).\\n uint256 public constant override MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH = 5;\\n\\n /// @notice dAPI management Merkle root hash type\\n /// @dev \\\"Hash type\\\" is what HashRegistry uses to address hashes used for\\n /// different purposes\\n bytes32 public constant override DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE =\\n keccak256(abi.encodePacked(\\\"dAPI management Merkle root\\\"));\\n\\n /// @notice dAPI pricing Merkle root hash type\\n bytes32 public constant override DAPI_PRICING_MERKLE_ROOT_HASH_TYPE =\\n keccak256(abi.encodePacked(\\\"dAPI pricing Merkle root\\\"));\\n\\n /// @notice Signed API URL Merkle root hash type\\n bytes32 public constant override SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE =\\n keccak256(abi.encodePacked(\\\"Signed API URL Merkle root\\\"));\\n\\n /// @notice Maximum dAPI update age. This contract cannot be used to set a\\n /// dAPI name to a data feed that has not been updated in the last\\n /// `MAXIMUM_DAPI_UPDATE_AGE`.\\n uint256 public constant override MAXIMUM_DAPI_UPDATE_AGE = 1 days;\\n\\n /// @notice Api3ServerV1 contract address\\n address public immutable override api3ServerV1;\\n\\n /// @notice ProxyFactory contract address\\n address public immutable override proxyFactory;\\n\\n /// @notice AirseekerRegistry contract address\\n address public immutable override airseekerRegistry;\\n\\n /// @notice Subscriptions indexed by their IDs\\n mapping(bytes32 => Subscription) public override subscriptions;\\n\\n /// @notice dAPI name to current subscription ID, which denotes the start\\n /// of the subscription queue for the dAPI\\n mapping(bytes32 => bytes32) public override dapiNameToCurrentSubscriptionId;\\n\\n // Update parameters hash map\\n mapping(bytes32 => bytes) private updateParametersHashToValue;\\n\\n // Length of abi.encode(address, bytes32)\\n uint256 private constant DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON =\\n 32 + 32;\\n\\n // Length of abi.encode(uint256, int224, uint256)\\n uint256 private constant UPDATE_PARAMETERS_LENGTH = 32 + 32 + 32;\\n\\n /// @dev Api3Market deploys its own AirseekerRegistry deterministically.\\n /// This implies that Api3Market-specific Airseekers should be operated by\\n /// pointing at this contract.\\n /// @param owner_ Owner address\\n /// @param proxyFactory_ ProxyFactory contract address\\n constructor(address owner_, address proxyFactory_) HashRegistry(owner_) {\\n proxyFactory = proxyFactory_;\\n address api3ServerV1_ = IProxyFactory(proxyFactory_).api3ServerV1();\\n api3ServerV1 = api3ServerV1_;\\n airseekerRegistry = address(\\n new AirseekerRegistry{salt: bytes32(0)}(\\n address(this),\\n api3ServerV1_\\n )\\n );\\n }\\n\\n /// @notice Returns the owner address\\n /// @return Owner address\\n function owner()\\n public\\n view\\n override(HashRegistry, IOwnable)\\n returns (address)\\n {\\n return super.owner();\\n }\\n\\n /// @notice Overriden to be disabled\\n function renounceOwnership() public pure override(HashRegistry, IOwnable) {\\n revert(\\\"Ownership cannot be renounced\\\");\\n }\\n\\n /// @notice Overriden to be disabled\\n function transferOwnership(\\n address\\n ) public pure override(HashRegistry, IOwnable) {\\n revert(\\\"Ownership cannot be transferred\\\");\\n }\\n\\n /// @notice Buys subscription and updates the current subscription ID if\\n /// necessary. The user is recommended to interact with this contract only\\n /// over the API3 Market frontend due to its complexity.\\n /// @dev The data feed that the dAPI name will be set to after this\\n /// function is called must be readied (see `validateDataFeedReadiness()`)\\n /// before calling this function.\\n /// Enough funds must be sent to put the sponsor wallet balance over its\\n /// expected amount after the subscription is bought. Since sponsor wallets\\n /// send data feed update transactions, it is not possible to estimate what\\n /// their balance will be at the time sent transactions are confirmed. To\\n /// avoid transactions being reverted as a result of this, consider sending\\n /// some extra.\\n /// @param dapiName dAPI name\\n /// @param dataFeedId Data feed ID\\n /// @param sponsorWallet Sponsor wallet address\\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\\n /// and proof\\n /// @param updateParameters Update parameters\\n /// @param duration Subscription duration\\n /// @param price Subscription price\\n /// @param dapiPricingMerkleData ABI-encoded dAPI pricing Merkle root and\\n /// proof\\n /// @return subscriptionId Subscription ID\\n function buySubscription(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n address payable sponsorWallet,\\n bytes calldata dapiManagementMerkleData,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price,\\n bytes calldata dapiPricingMerkleData\\n ) external payable override returns (bytes32 subscriptionId) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n require(sponsorWallet != address(0), \\\"Sponsor wallet address zero\\\");\\n verifyDapiManagementMerkleProof(\\n dapiName,\\n dataFeedId,\\n sponsorWallet,\\n dapiManagementMerkleData\\n );\\n verifyDapiPricingMerkleProof(\\n dapiName,\\n updateParameters,\\n duration,\\n price,\\n dapiPricingMerkleData\\n );\\n subscriptionId = addSubscriptionToQueue(\\n dapiName,\\n dataFeedId,\\n updateParameters,\\n duration,\\n price\\n );\\n require(\\n sponsorWallet.balance + msg.value >=\\n computeExpectedSponsorWalletBalance(dapiName),\\n \\\"Insufficient payment\\\"\\n );\\n emit BoughtSubscription(\\n dapiName,\\n subscriptionId,\\n dataFeedId,\\n sponsorWallet,\\n updateParameters,\\n duration,\\n price,\\n msg.value\\n );\\n if (msg.value > 0) {\\n (bool success, ) = sponsorWallet.call{value: msg.value}(\\\"\\\");\\n require(success, \\\"Transfer unsuccessful\\\");\\n }\\n }\\n\\n /// @notice If the current subscription has ended, updates it with the one\\n /// that will end next\\n /// @dev The fact that there is a current subscription that has ended would\\n /// mean that API3 is providing a service that was not paid for. Therefore,\\n /// API3 should poll this function for all active dAPI names and call it\\n /// whenever it is not going to revert to downgrade the specs.\\n /// @param dapiName dAPI name\\n function updateCurrentSubscriptionId(bytes32 dapiName) public override {\\n bytes32 currentSubscriptionId = dapiNameToCurrentSubscriptionId[\\n dapiName\\n ];\\n require(\\n currentSubscriptionId != bytes32(0),\\n \\\"Subscription queue empty\\\"\\n );\\n require(\\n subscriptions[currentSubscriptionId].endTimestamp <=\\n block.timestamp,\\n \\\"Current subscription not ended\\\"\\n );\\n updateEndedCurrentSubscriptionId(dapiName, currentSubscriptionId);\\n }\\n\\n /// @notice Updates the dAPI name to match the respective Merkle leaf\\n /// @dev Buying a dAPI subscription always updates the dAPI name if\\n /// necessary. However, API3 may also publish new Merkle roots between\\n /// subscription purchases, in which case API3 should call this function to\\n /// bring the chain state up to date. Therefore, API3 should poll this\\n /// function for all active dAPI names and call it whenever it will not\\n /// revert.\\n /// Similar to `buySubscription()`, this function requires the data feed\\n /// that the dAPI will be pointed to to be readied.\\n /// This function is allowed to be called even when the respective dAPI is\\n /// not active, which means that a dAPI name being set does not imply that\\n /// the respective data feed is in service. Users should only use dAPIs for\\n /// which there is an active subscription with the update parameters that\\n /// satisfy their needs.\\n /// @param dapiName dAPI name\\n /// @param dataFeedId Data feed ID\\n /// @param sponsorWallet Sponsor wallet address\\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\\n /// and proof\\n function updateDapiName(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n address sponsorWallet,\\n bytes calldata dapiManagementMerkleData\\n ) external override {\\n if (dataFeedId != bytes32(0)) {\\n require(sponsorWallet != address(0), \\\"Sponsor wallet address zero\\\");\\n } else {\\n require(\\n sponsorWallet == address(0),\\n \\\"Sponsor wallet address not zero\\\"\\n );\\n }\\n verifyDapiManagementMerkleProof(\\n dapiName,\\n dataFeedId,\\n sponsorWallet,\\n dapiManagementMerkleData\\n );\\n bytes32 currentDataFeedId = IApi3ServerV1(api3ServerV1)\\n .dapiNameHashToDataFeedId(keccak256(abi.encodePacked(dapiName)));\\n require(currentDataFeedId != dataFeedId, \\\"Does not update dAPI name\\\");\\n if (dataFeedId != bytes32(0)) {\\n validateDataFeedReadiness(dataFeedId);\\n }\\n IApi3ServerV1(api3ServerV1).setDapiName(dapiName, dataFeedId);\\n }\\n\\n /// @notice Updates the signed API URL of the Airnode to match the\\n /// respective Merkle leaf\\n /// @dev Unlike the dAPI management and pricing Merkle leaves, the signed\\n /// API URL Merkle leaves are not registered by the users as a part of\\n /// subscription purchase transactions. API3 should poll this function for\\n /// all Airnodes that are used in active dAPIs and call it whenever it will\\n /// not revert.\\n /// @param airnode Airnode address\\n /// @param signedApiUrl Signed API URL\\n /// @param signedApiUrlMerkleData ABI-encoded signed API URL Merkle root\\n /// and proof\\n function updateSignedApiUrl(\\n address airnode,\\n string calldata signedApiUrl,\\n bytes calldata signedApiUrlMerkleData\\n ) external override {\\n verifySignedApiUrlMerkleProof(\\n airnode,\\n signedApiUrl,\\n signedApiUrlMerkleData\\n );\\n require(\\n keccak256(abi.encodePacked(signedApiUrl)) !=\\n keccak256(\\n abi.encodePacked(\\n AirseekerRegistry(airseekerRegistry)\\n .airnodeToSignedApiUrl(airnode)\\n )\\n ),\\n \\\"Does not update signed API URL\\\"\\n );\\n AirseekerRegistry(airseekerRegistry).setSignedApiUrl(\\n airnode,\\n signedApiUrl\\n );\\n }\\n\\n /// @notice Calls Api3ServerV1 to update the Beacon using data signed by\\n /// the Airnode\\n /// @dev The user is intended to make a multicall transaction through the\\n /// API3 Market frontend to satisfy the required conditions to be able to\\n /// buy a subscription and buy the subscription in a single transaction.\\n /// The functions to which external calls must be made to to satisfy said\\n /// conditions (such as this one) are added to this contract so that they\\n /// can be multi-called by the user.\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @param timestamp Signature timestamp\\n /// @param data Update data (an `int256` encoded in contract ABI)\\n /// @param signature Template ID, timestamp and the update data signed by\\n /// the Airnode\\n /// @return beaconId Updated Beacon ID\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external override returns (bytes32 beaconId) {\\n return\\n IApi3ServerV1(api3ServerV1).updateBeaconWithSignedData(\\n airnode,\\n templateId,\\n timestamp,\\n data,\\n signature\\n );\\n }\\n\\n /// @notice Calls Api3ServerV1 to update the Beacon set using the current\\n /// values of its Beacons\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Updated Beacon set ID\\n function updateBeaconSetWithBeacons(\\n bytes32[] calldata beaconIds\\n ) external override returns (bytes32 beaconSetId) {\\n return\\n IApi3ServerV1(api3ServerV1).updateBeaconSetWithBeacons(beaconIds);\\n }\\n\\n /// @notice Calls ProxyFactory to deterministically deploy the dAPI proxy\\n /// @dev It is recommended for the users to read data feeds through proxies\\n /// deployed by ProxyFactory, rather than calling Api3ServerV1 directly.\\n /// Even though proxy deployment is not a condition for purchasing\\n /// subscriptions, the interface is implemented here to allow the user to\\n /// purchase a dAPI subscription and deploy the respective proxy in the\\n /// same transaction with a multicall.\\n /// @param dapiName dAPI name\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n proxyAddress = IProxyFactory(proxyFactory).deployDapiProxy(\\n dapiName,\\n metadata\\n );\\n }\\n\\n /// @notice Calls ProxyFactory to deterministically deploy the dAPI proxy\\n /// with OEV support\\n /// @param dapiName dAPI name\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n proxyAddress = IProxyFactory(proxyFactory).deployDapiProxyWithOev(\\n dapiName,\\n oevBeneficiary,\\n metadata\\n );\\n }\\n\\n /// @notice Calls AirseekerRegistry to register the data feed\\n /// @param dataFeedDetails Data feed details\\n /// @return dataFeedId Data feed ID\\n function registerDataFeed(\\n bytes calldata dataFeedDetails\\n ) external override returns (bytes32 dataFeedId) {\\n dataFeedId = AirseekerRegistry(airseekerRegistry).registerDataFeed(\\n dataFeedDetails\\n );\\n }\\n\\n /// @notice Computes the expected sponsor wallet balance based on the\\n /// current subscription queue\\n /// @dev API3 estimates the transaction fee cost of subscriptions, and\\n /// prices them accordingly. The subscription fees paid for a dAPI are sent\\n /// to the respective sponsor wallet, which will send the update\\n /// transactions. In the case that a subscription is overpriced, the extra\\n /// funds are automatically rolled over as a discount to the next\\n /// subscription bought for the same dAPI. In the case that a subscription\\n /// is underpriced, there is a risk of the sponsor wallet running out of\\n /// funds, resulting in the subscription specs to not be met. To avoid\\n /// this, API3 should poll this function for all active dAPI names, check\\n /// the respective sponsor wallet balances, and top up the sponsor wallets\\n /// as necessary. The conditions that result in the underpricing will most\\n /// likely require an updated dAPI pricing Merkle root to be published.\\n /// @param dapiName dAPI name\\n /// @return expectedSponsorWalletBalance Expected sponsor wallet balance\\n function computeExpectedSponsorWalletBalance(\\n bytes32 dapiName\\n ) public view override returns (uint256 expectedSponsorWalletBalance) {\\n uint32 startTimestamp = SafeCast.toUint32(block.timestamp);\\n Subscription storage queuedSubscription;\\n for (\\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\\n dapiName\\n ];\\n queuedSubscriptionId != bytes32(0);\\n queuedSubscriptionId = queuedSubscription.nextSubscriptionId\\n ) {\\n queuedSubscription = subscriptions[queuedSubscriptionId];\\n uint32 endTimestamp = queuedSubscription.endTimestamp;\\n if (endTimestamp > block.timestamp) {\\n expectedSponsorWalletBalance +=\\n ((endTimestamp - startTimestamp) *\\n queuedSubscription.dailyPrice) /\\n 1 days;\\n startTimestamp = endTimestamp;\\n }\\n }\\n }\\n\\n /// @notice Computes the expected sponsor wallet balance after the\\n /// respective subscription is added to the queue\\n /// @dev This function is intended to be used by the API3 Market frontend\\n /// to calculate how much the user should pay to purchase a specific\\n /// subscription. As mentioned in the `buySubscription()` docstring, the\\n /// user should aim for the sponsor wallet balance to be slightly more than\\n /// the required amount in case it sends a transaction in the meantime,\\n /// whose gas cost may decrease the sponsor wallet balance unexpectedly.\\n /// Unit prices of the queued subscriptions are recorded on a daily basis\\n /// and the expected balance is computed from these, which introduces a\\n /// rounding error in the order of Weis. This also applies in practice (in\\n /// that one can buy a subscription whose price is 1 ETH at 0.999... ETH).\\n /// This behavior is accepted due to being trivial in effect.\\n /// @param dapiName dAPI name\\n /// @param updateParameters Update parameters\\n /// @param duration Subscription duration\\n /// @param price Subscription price\\n /// @return expectedSponsorWalletBalance Expected sponsor wallet balance\\n function computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(\\n bytes32 dapiName,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price\\n ) external view override returns (uint256 expectedSponsorWalletBalance) {\\n require(\\n updateParameters.length == UPDATE_PARAMETERS_LENGTH,\\n \\\"Update parameters length invalid\\\"\\n );\\n (\\n bytes32 subscriptionId,\\n uint32 endTimestamp,\\n bytes32 previousSubscriptionId,\\n bytes32 nextSubscriptionId\\n ) = prospectSubscriptionPositionInQueue(\\n dapiName,\\n updateParameters,\\n duration\\n );\\n uint256 dailyPrice = (price * 1 days) / duration;\\n uint32 startTimestamp = SafeCast.toUint32(block.timestamp);\\n bytes32 queuedSubscriptionId = previousSubscriptionId == bytes32(0)\\n ? subscriptionId\\n : dapiNameToCurrentSubscriptionId[dapiName];\\n for (; queuedSubscriptionId != bytes32(0); ) {\\n if (queuedSubscriptionId == subscriptionId) {\\n expectedSponsorWalletBalance +=\\n ((endTimestamp - startTimestamp) * dailyPrice) /\\n 1 days;\\n startTimestamp = endTimestamp;\\n queuedSubscriptionId = nextSubscriptionId;\\n } else {\\n Subscription storage queuedSubscription = subscriptions[\\n queuedSubscriptionId\\n ];\\n uint32 queuedSubscriptionEndTimestamp = queuedSubscription\\n .endTimestamp;\\n if (queuedSubscriptionEndTimestamp > block.timestamp) {\\n expectedSponsorWalletBalance +=\\n ((queuedSubscriptionEndTimestamp - startTimestamp) *\\n queuedSubscription.dailyPrice) /\\n 1 days;\\n startTimestamp = queuedSubscriptionEndTimestamp;\\n }\\n if (previousSubscriptionId == queuedSubscriptionId) {\\n queuedSubscriptionId = subscriptionId;\\n } else {\\n queuedSubscriptionId = queuedSubscription\\n .nextSubscriptionId;\\n }\\n }\\n }\\n }\\n\\n /// @notice Gets all data about the dAPI that is available\\n /// @dev This function is intended to be used by the API3 Market frontend\\n /// to get all data related to a specific dAPI. It returns the entire\\n /// subscription queue, including the items whose end timestamps are in the\\n /// past.\\n /// @param dapiName dAPI name\\n /// @return dataFeedDetails Data feed details\\n /// @return dapiValue dAPI value read from Api3ServerV1\\n /// @return dapiTimestamp dAPI timestamp read from Api3ServerV1\\n /// @return beaconValues Beacon values read from Api3ServerV1\\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\\n /// @return updateParameters Update parameters of the subscriptions in the\\n /// queue\\n /// @return endTimestamps End timestamps of the subscriptions in the queue\\n /// @return dailyPrices Daily prices of the subscriptions in the queue\\n function getDapiData(\\n bytes32 dapiName\\n )\\n external\\n view\\n override\\n returns (\\n bytes memory dataFeedDetails,\\n int224 dapiValue,\\n uint32 dapiTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps,\\n bytes[] memory updateParameters,\\n uint32[] memory endTimestamps,\\n uint224[] memory dailyPrices\\n )\\n {\\n bytes32 currentDataFeedId = IApi3ServerV1(api3ServerV1)\\n .dapiNameHashToDataFeedId(keccak256(abi.encodePacked(dapiName)));\\n (\\n dataFeedDetails,\\n dapiValue,\\n dapiTimestamp,\\n beaconValues,\\n beaconTimestamps\\n ) = getDataFeedData(currentDataFeedId);\\n uint256 queueLength = 0;\\n for (\\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\\n dapiName\\n ];\\n queuedSubscriptionId != bytes32(0);\\n queuedSubscriptionId = subscriptions[queuedSubscriptionId]\\n .nextSubscriptionId\\n ) {\\n queueLength++;\\n }\\n updateParameters = new bytes[](queueLength);\\n endTimestamps = new uint32[](queueLength);\\n dailyPrices = new uint224[](queueLength);\\n Subscription storage queuedSubscription = subscriptions[\\n dapiNameToCurrentSubscriptionId[dapiName]\\n ];\\n for (uint256 ind = 0; ind < queueLength; ind++) {\\n updateParameters[ind] = updateParametersHashToValue[\\n queuedSubscription.updateParametersHash\\n ];\\n endTimestamps[ind] = queuedSubscription.endTimestamp;\\n dailyPrices[ind] = queuedSubscription.dailyPrice;\\n queuedSubscription = subscriptions[\\n queuedSubscription.nextSubscriptionId\\n ];\\n }\\n }\\n\\n /// @notice Gets all data about the data feed that is available\\n /// @dev This function is intended to be used by the API3 Market frontend\\n /// to determine what needs to be done to ready the data feed to purchase\\n /// the respective subscription.\\n /// @param dataFeedId Data feed ID\\n /// @return dataFeedDetails Data feed details\\n /// @return dataFeedValue Data feed value read from Api3ServerV1\\n /// @return dataFeedTimestamp Data feed timestamp read from Api3ServerV1\\n /// @return beaconValues Beacon values read from Api3ServerV1\\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\\n function getDataFeedData(\\n bytes32 dataFeedId\\n )\\n public\\n view\\n returns (\\n bytes memory dataFeedDetails,\\n int224 dataFeedValue,\\n uint32 dataFeedTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps\\n )\\n {\\n dataFeedDetails = AirseekerRegistry(airseekerRegistry)\\n .dataFeedIdToDetails(dataFeedId);\\n (dataFeedValue, dataFeedTimestamp) = IApi3ServerV1(api3ServerV1)\\n .dataFeeds(dataFeedId);\\n if (\\n dataFeedDetails.length == DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\\n ) {\\n beaconValues = new int224[](1);\\n beaconTimestamps = new uint32[](1);\\n (address airnode, bytes32 templateId) = abi.decode(\\n dataFeedDetails,\\n (address, bytes32)\\n );\\n (beaconValues[0], beaconTimestamps[0]) = IApi3ServerV1(api3ServerV1)\\n .dataFeeds(deriveBeaconId(airnode, templateId));\\n } else {\\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\\n .decode(dataFeedDetails, (address[], bytes32[]));\\n uint256 beaconCount = airnodes.length;\\n beaconValues = new int224[](beaconCount);\\n beaconTimestamps = new uint32[](beaconCount);\\n for (uint256 ind = 0; ind < beaconCount; ind++) {\\n (beaconValues[ind], beaconTimestamps[ind]) = IApi3ServerV1(\\n api3ServerV1\\n ).dataFeeds(deriveBeaconId(airnodes[ind], templateIds[ind]));\\n }\\n }\\n }\\n\\n /// @notice Subscription ID to update parameters\\n /// @param subscriptionId Subscription ID\\n /// @return updateParameters Update parameters\\n function subscriptionIdToUpdateParameters(\\n bytes32 subscriptionId\\n ) public view override returns (bytes memory updateParameters) {\\n updateParameters = updateParametersHashToValue[\\n subscriptions[subscriptionId].updateParametersHash\\n ];\\n }\\n\\n /// @notice Returns the signature delegation hash type used in delegation\\n /// signatures\\n /// @return Signature delegation hash type\\n function signatureDelegationHashType()\\n public\\n view\\n virtual\\n override(HashRegistry, IHashRegistry)\\n returns (bytes32)\\n {\\n return keccak256(abi.encodePacked(\\\"Api3Market signature delegation\\\"));\\n }\\n\\n /// @notice Adds the subscription to the queue if applicable\\n /// @param dapiName dAPI name\\n /// @param dataFeedId Data feed ID\\n /// @param updateParameters Update parameters\\n /// @param duration Subscription duration\\n /// @param price Subscription price\\n function addSubscriptionToQueue(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price\\n ) private returns (bytes32 subscriptionId) {\\n uint32 endTimestamp;\\n bytes32 previousSubscriptionId;\\n bytes32 nextSubscriptionId;\\n (\\n subscriptionId,\\n endTimestamp,\\n previousSubscriptionId,\\n nextSubscriptionId\\n ) = prospectSubscriptionPositionInQueue(\\n dapiName,\\n updateParameters,\\n duration\\n );\\n bytes32 updateParametersHash = keccak256(updateParameters);\\n if (updateParametersHashToValue[updateParametersHash].length == 0) {\\n updateParametersHashToValue[\\n updateParametersHash\\n ] = updateParameters;\\n }\\n subscriptions[subscriptionId] = Subscription({\\n updateParametersHash: updateParametersHash,\\n endTimestamp: endTimestamp,\\n dailyPrice: SafeCast.toUint224((price * 1 days) / duration),\\n nextSubscriptionId: nextSubscriptionId\\n });\\n if (previousSubscriptionId == bytes32(0)) {\\n if (subscriptionId != dapiNameToCurrentSubscriptionId[dapiName]) {\\n emit UpdatedCurrentSubscriptionId(dapiName, subscriptionId);\\n dapiNameToCurrentSubscriptionId[dapiName] = subscriptionId;\\n }\\n AirseekerRegistry(airseekerRegistry).setDapiNameUpdateParameters(\\n dapiName,\\n updateParameters\\n );\\n AirseekerRegistry(airseekerRegistry).setDapiNameToBeActivated(\\n dapiName\\n );\\n } else {\\n subscriptions[previousSubscriptionId]\\n .nextSubscriptionId = subscriptionId;\\n bytes32 currentSubscriptionId = dapiNameToCurrentSubscriptionId[\\n dapiName\\n ];\\n if (\\n subscriptions[currentSubscriptionId].endTimestamp <=\\n block.timestamp\\n ) {\\n updateEndedCurrentSubscriptionId(\\n dapiName,\\n currentSubscriptionId\\n );\\n }\\n }\\n validateDataFeedReadiness(dataFeedId);\\n if (\\n IApi3ServerV1(api3ServerV1).dapiNameHashToDataFeedId(\\n keccak256(abi.encodePacked(dapiName))\\n ) != dataFeedId\\n ) {\\n IApi3ServerV1(api3ServerV1).setDapiName(dapiName, dataFeedId);\\n }\\n }\\n\\n /// @notice Updates the current subscription that has ended with the one\\n /// that will end next\\n /// @param dapiName dAPI name\\n /// @param currentSubscriptionId Current subscription ID\\n function updateEndedCurrentSubscriptionId(\\n bytes32 dapiName,\\n bytes32 currentSubscriptionId\\n ) private {\\n do {\\n currentSubscriptionId = subscriptions[currentSubscriptionId]\\n .nextSubscriptionId;\\n } while (\\n currentSubscriptionId != bytes32(0) &&\\n subscriptions[currentSubscriptionId].endTimestamp <=\\n block.timestamp\\n );\\n emit UpdatedCurrentSubscriptionId(dapiName, currentSubscriptionId);\\n dapiNameToCurrentSubscriptionId[dapiName] = currentSubscriptionId;\\n if (currentSubscriptionId == bytes32(0)) {\\n AirseekerRegistry(airseekerRegistry).setDapiNameToBeDeactivated(\\n dapiName\\n );\\n } else {\\n AirseekerRegistry(airseekerRegistry).setDapiNameUpdateParameters(\\n dapiName,\\n subscriptionIdToUpdateParameters(currentSubscriptionId)\\n );\\n }\\n }\\n\\n /// @notice Prospects the subscription position in the queue. It iterates\\n /// through the entire subscription queue, which is implemented as a linked\\n /// list, and returns the previous and next nodes of the subscription to be\\n /// added.\\n /// It reverts if no suitable position can be found, which would be because\\n /// the addition of the subscription to the queue does not upgrade its\\n /// specs unambiguously or addition of it results in the maximum queue\\n /// length to be exceeded.\\n /// @param dapiName dAPI name\\n /// @param updateParameters Update parameters\\n /// @param duration Subscription duration\\n /// @return subscriptionId Subscription ID\\n /// @return endTimestamp End timestamp\\n /// @return previousSubscriptionId Previous subscription ID\\n /// @return nextSubscriptionId Next subscription ID\\n function prospectSubscriptionPositionInQueue(\\n bytes32 dapiName,\\n bytes calldata updateParameters,\\n uint256 duration\\n )\\n private\\n view\\n returns (\\n bytes32 subscriptionId,\\n uint32 endTimestamp,\\n bytes32 previousSubscriptionId,\\n bytes32 nextSubscriptionId\\n )\\n {\\n subscriptionId = keccak256(\\n abi.encodePacked(dapiName, keccak256(updateParameters))\\n );\\n endTimestamp = SafeCast.toUint32(block.timestamp + duration);\\n (\\n uint256 deviationThresholdInPercentage,\\n int224 deviationReference,\\n uint256 heartbeatInterval\\n ) = abi.decode(updateParameters, (uint256, int224, uint256));\\n uint256 newQueueLength = 0;\\n Subscription storage queuedSubscription;\\n for (\\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\\n dapiName\\n ];\\n queuedSubscriptionId != bytes32(0);\\n queuedSubscriptionId = queuedSubscription.nextSubscriptionId\\n ) {\\n queuedSubscription = subscriptions[queuedSubscriptionId];\\n UpdateParametersComparisonResult updateParametersComparisonResult = compareUpdateParametersWithQueued(\\n deviationThresholdInPercentage,\\n deviationReference,\\n heartbeatInterval,\\n queuedSubscription.updateParametersHash\\n );\\n uint32 queuedSubscriptionEndTimestamp = queuedSubscription\\n .endTimestamp;\\n require(\\n updateParametersComparisonResult ==\\n UpdateParametersComparisonResult.BetterThanQueued ||\\n endTimestamp > queuedSubscriptionEndTimestamp,\\n \\\"Subscription does not upgrade\\\"\\n );\\n if (\\n updateParametersComparisonResult ==\\n UpdateParametersComparisonResult.WorseThanQueued &&\\n queuedSubscriptionEndTimestamp > block.timestamp\\n ) {\\n previousSubscriptionId = queuedSubscriptionId;\\n newQueueLength++;\\n }\\n if (\\n updateParametersComparisonResult ==\\n UpdateParametersComparisonResult.BetterThanQueued &&\\n endTimestamp < queuedSubscriptionEndTimestamp\\n ) {\\n nextSubscriptionId = queuedSubscriptionId;\\n for (\\n ;\\n queuedSubscriptionId != bytes32(0);\\n queuedSubscriptionId = subscriptions[queuedSubscriptionId]\\n .nextSubscriptionId\\n ) {\\n newQueueLength++;\\n }\\n break;\\n }\\n }\\n require(\\n newQueueLength < MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH,\\n \\\"Subscription queue full\\\"\\n );\\n }\\n\\n /// @notice Compares the update parameters with the ones that belong to a\\n /// queued subscription\\n /// @param deviationThresholdInPercentage Deviation threshold in percentage\\n /// @param deviationReference Deviation reference\\n /// @param heartbeatInterval Heartbeat interval\\n /// @param queuedUpdateParametersHash Queued update parameters hash\\n /// @return Update parameters comparison result\\n function compareUpdateParametersWithQueued(\\n uint256 deviationThresholdInPercentage,\\n int224 deviationReference,\\n uint256 heartbeatInterval,\\n bytes32 queuedUpdateParametersHash\\n ) private view returns (UpdateParametersComparisonResult) {\\n // The update parameters that belong to a queued subscription are\\n // guaranteed to have been stored in the hash map\\n (\\n uint256 queuedDeviationThresholdInPercentage,\\n int224 queuedDeviationReference,\\n uint256 queuedHeartbeatInterval\\n ) = abi.decode(\\n updateParametersHashToValue[queuedUpdateParametersHash],\\n (uint256, int224, uint256)\\n );\\n require(\\n deviationReference == queuedDeviationReference,\\n \\\"Deviation references not equal\\\"\\n );\\n if (\\n (deviationThresholdInPercentage ==\\n queuedDeviationThresholdInPercentage) &&\\n (heartbeatInterval == queuedHeartbeatInterval)\\n ) {\\n return UpdateParametersComparisonResult.EqualToQueued;\\n } else if (\\n (deviationThresholdInPercentage <=\\n queuedDeviationThresholdInPercentage) &&\\n (heartbeatInterval <= queuedHeartbeatInterval)\\n ) {\\n return UpdateParametersComparisonResult.BetterThanQueued;\\n } else if (\\n (deviationThresholdInPercentage >=\\n queuedDeviationThresholdInPercentage) &&\\n (heartbeatInterval >= queuedHeartbeatInterval)\\n ) {\\n return UpdateParametersComparisonResult.WorseThanQueued;\\n } else {\\n // This is hit when the set of parameters are superior to each\\n // other in different aspects, in which case they should not be\\n // allowed to be in the same queue\\n revert(\\\"Update parameters incomparable\\\");\\n }\\n }\\n\\n /// @notice Validates the readiness of the data feed. The data feed must\\n /// have been updated on Api3ServerV1 in the last `MAXIMUM_DAPI_UPDATE_AGE`\\n /// and registered on AirseekerRegistry.\\n /// @param dataFeedId Data feed ID\\n function validateDataFeedReadiness(bytes32 dataFeedId) private view {\\n (, uint32 timestamp) = IApi3ServerV1(api3ServerV1).dataFeeds(\\n dataFeedId\\n );\\n require(\\n block.timestamp <= timestamp + MAXIMUM_DAPI_UPDATE_AGE,\\n \\\"Data feed value stale\\\"\\n );\\n require(\\n AirseekerRegistry(airseekerRegistry).dataFeedIsRegistered(\\n dataFeedId\\n ),\\n \\\"Data feed not registered\\\"\\n );\\n }\\n\\n /// @notice Verifies the dAPI management Merkle proof\\n /// @param dapiName dAPI name\\n /// @param dataFeedId Data feed ID\\n /// @param sponsorWallet Sponsor wallet address\\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\\n /// and proof\\n function verifyDapiManagementMerkleProof(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n address sponsorWallet,\\n bytes calldata dapiManagementMerkleData\\n ) private view {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n (\\n bytes32 dapiManagementMerkleRoot,\\n bytes32[] memory dapiManagementMerkleProof\\n ) = abi.decode(dapiManagementMerkleData, (bytes32, bytes32[]));\\n require(\\n hashes[DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE].value ==\\n dapiManagementMerkleRoot,\\n \\\"Invalid root\\\"\\n );\\n require(\\n MerkleProof.verify(\\n dapiManagementMerkleProof,\\n dapiManagementMerkleRoot,\\n keccak256(\\n bytes.concat(\\n keccak256(\\n abi.encode(dapiName, dataFeedId, sponsorWallet)\\n )\\n )\\n )\\n ),\\n \\\"Invalid proof\\\"\\n );\\n }\\n\\n /// @notice Verifies the dAPI pricing Merkle proof\\n /// @param dapiName dAPI name\\n /// @param updateParameters Update parameters\\n /// @param duration Subscription duration\\n /// @param price Subscription price\\n /// @param dapiPricingMerkleData ABI-encoded dAPI pricing Merkle root and\\n /// proof\\n function verifyDapiPricingMerkleProof(\\n bytes32 dapiName,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price,\\n bytes calldata dapiPricingMerkleData\\n ) private view {\\n require(\\n updateParameters.length == UPDATE_PARAMETERS_LENGTH,\\n \\\"Update parameters length invalid\\\"\\n );\\n require(duration != 0, \\\"Duration zero\\\");\\n require(price != 0, \\\"Price zero\\\");\\n (\\n bytes32 dapiPricingMerkleRoot,\\n bytes32[] memory dapiPricingMerkleProof\\n ) = abi.decode(dapiPricingMerkleData, (bytes32, bytes32[]));\\n require(\\n hashes[DAPI_PRICING_MERKLE_ROOT_HASH_TYPE].value ==\\n dapiPricingMerkleRoot,\\n \\\"Invalid root\\\"\\n );\\n require(\\n MerkleProof.verify(\\n dapiPricingMerkleProof,\\n dapiPricingMerkleRoot,\\n keccak256(\\n bytes.concat(\\n keccak256(\\n abi.encode(\\n dapiName,\\n block.chainid,\\n updateParameters,\\n duration,\\n price\\n )\\n )\\n )\\n )\\n ),\\n \\\"Invalid proof\\\"\\n );\\n }\\n\\n /// @notice Verifies the signed API URL Merkle proof\\n /// @param airnode Airnode address\\n /// @param signedApiUrl Signed API URL\\n /// @param signedApiUrlMerkleData ABI-encoded signed API URL Merkle root\\n /// and proof\\n function verifySignedApiUrlMerkleProof(\\n address airnode,\\n string calldata signedApiUrl,\\n bytes calldata signedApiUrlMerkleData\\n ) private view {\\n (\\n bytes32 signedApiUrlMerkleRoot,\\n bytes32[] memory signedApiUrlMerkleProof\\n ) = abi.decode(signedApiUrlMerkleData, (bytes32, bytes32[]));\\n require(\\n hashes[SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE].value ==\\n signedApiUrlMerkleRoot,\\n \\\"Invalid root\\\"\\n );\\n require(\\n MerkleProof.verify(\\n signedApiUrlMerkleProof,\\n signedApiUrlMerkleRoot,\\n keccak256(\\n bytes.concat(keccak256(abi.encode(airnode, signedApiUrl)))\\n )\\n ),\\n \\\"Invalid proof\\\"\\n );\\n }\\n\\n /// @notice Derives the Beacon ID from the Airnode address and template ID\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @return beaconId Beacon ID\\n function deriveBeaconId(\\n address airnode,\\n bytes32 templateId\\n ) private pure returns (bytes32 beaconId) {\\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\\n }\\n}\\n\",\"keccak256\":\"0xe8a71b9d8a5345cf6fb1bd06751526bafa7204b6c9245b712a467acfa9157d47\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IAirseekerRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access/interfaces/IOwnable.sol\\\";\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IAirseekerRegistry is IOwnable, IExtendedSelfMulticall {\\n event ActivatedDataFeedId(bytes32 indexed dataFeedId);\\n\\n event ActivatedDapiName(bytes32 indexed dapiName);\\n\\n event DeactivatedDataFeedId(bytes32 indexed dataFeedId);\\n\\n event DeactivatedDapiName(bytes32 indexed dapiName);\\n\\n event UpdatedDataFeedIdUpdateParameters(\\n bytes32 indexed dataFeedId,\\n bytes updateParameters\\n );\\n\\n event UpdatedDapiNameUpdateParameters(\\n bytes32 indexed dapiName,\\n bytes updateParameters\\n );\\n\\n event UpdatedSignedApiUrl(address indexed airnode, string signedApiUrl);\\n\\n event RegisteredDataFeed(bytes32 indexed dataFeedId, bytes dataFeedDetails);\\n\\n function setDataFeedIdToBeActivated(bytes32 dataFeedId) external;\\n\\n function setDapiNameToBeActivated(bytes32 dapiName) external;\\n\\n function setDataFeedIdToBeDeactivated(bytes32 dataFeedId) external;\\n\\n function setDapiNameToBeDeactivated(bytes32 dapiName) external;\\n\\n function setDataFeedIdUpdateParameters(\\n bytes32 dataFeedId,\\n bytes calldata updateParameters\\n ) external;\\n\\n function setDapiNameUpdateParameters(\\n bytes32 dapiName,\\n bytes calldata updateParameters\\n ) external;\\n\\n function setSignedApiUrl(\\n address airnode,\\n string calldata signedApiUrl\\n ) external;\\n\\n function registerDataFeed(\\n bytes calldata dataFeedDetails\\n ) external returns (bytes32 dataFeedId);\\n\\n function activeDataFeed(\\n uint256 index\\n )\\n external\\n view\\n returns (\\n bytes32 dataFeedId,\\n bytes32 dapiName,\\n bytes memory dataFeedDetails,\\n int224 dataFeedValue,\\n uint32 dataFeedTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps,\\n bytes memory updateParameters,\\n string[] memory signedApiUrls\\n );\\n\\n function activeDataFeedCount() external view returns (uint256);\\n\\n function activeDataFeedIdCount() external view returns (uint256);\\n\\n function activeDapiNameCount() external view returns (uint256);\\n\\n function dataFeedIdToUpdateParameters(\\n bytes32 dataFeedId\\n ) external view returns (bytes memory updateParameters);\\n\\n function dapiNameToUpdateParameters(\\n bytes32 dapiName\\n ) external view returns (bytes memory updateParameters);\\n\\n function dataFeedIsRegistered(\\n bytes32 dataFeedId\\n ) external view returns (bool);\\n\\n function MAXIMUM_BEACON_COUNT_IN_SET() external view returns (uint256);\\n\\n function MAXIMUM_UPDATE_PARAMETERS_LENGTH() external view returns (uint256);\\n\\n function MAXIMUM_SIGNED_API_URL_LENGTH() external view returns (uint256);\\n\\n function api3ServerV1() external view returns (address);\\n\\n function airnodeToSignedApiUrl(\\n address airnode\\n ) external view returns (string memory signedApiUrl);\\n\\n function dataFeedIdToDetails(\\n bytes32 dataFeedId\\n ) external view returns (bytes memory dataFeedDetails);\\n}\\n\",\"keccak256\":\"0xdbc7e84e55802570ee304651b9827c72d001f1755792f69acca5da648792044d\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3Market.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access/interfaces/IHashRegistry.sol\\\";\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IApi3Market is IHashRegistry, IExtendedSelfMulticall {\\n event BoughtSubscription(\\n bytes32 indexed dapiName,\\n bytes32 indexed subscriptionId,\\n bytes32 dataFeedId,\\n address sponsorWallet,\\n bytes updateParameters,\\n uint256 duration,\\n uint256 price,\\n uint256 paymentAmount\\n );\\n\\n event UpdatedCurrentSubscriptionId(\\n bytes32 indexed dapiName,\\n bytes32 indexed subscriptionId\\n );\\n\\n function buySubscription(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n address payable sponsorWallet,\\n bytes calldata dapiManagementMerkleData,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price,\\n bytes calldata dapiPricingMerkleData\\n ) external payable returns (bytes32 subscriptionId);\\n\\n function updateCurrentSubscriptionId(bytes32 dapiName) external;\\n\\n function updateDapiName(\\n bytes32 dapiName,\\n bytes32 dataFeedId,\\n address sponsorWallet,\\n bytes calldata dapiManagementMerkleData\\n ) external;\\n\\n function updateSignedApiUrl(\\n address airnode,\\n string calldata signedApiUrl,\\n bytes calldata signedApiUrlMerkleData\\n ) external;\\n\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] calldata beaconIds\\n ) external returns (bytes32 beaconSetId);\\n\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function registerDataFeed(\\n bytes calldata dataFeedDetails\\n ) external returns (bytes32 dataFeedId);\\n\\n function computeExpectedSponsorWalletBalance(\\n bytes32 dapiName\\n ) external view returns (uint256 expectedSponsorWalletBalance);\\n\\n function computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(\\n bytes32 dapiName,\\n bytes calldata updateParameters,\\n uint256 duration,\\n uint256 price\\n ) external view returns (uint256 expectedSponsorWalletBalance);\\n\\n function getDapiData(\\n bytes32 dapiName\\n )\\n external\\n view\\n returns (\\n bytes memory dataFeedDetails,\\n int224 dapiValue,\\n uint32 dapiTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps,\\n bytes[] memory updateParameters,\\n uint32[] memory endTimestamps,\\n uint224[] memory dailyPrices\\n );\\n\\n function getDataFeedData(\\n bytes32 dataFeedId\\n )\\n external\\n view\\n returns (\\n bytes memory dataFeedDetails,\\n int224 dataFeedValue,\\n uint32 dataFeedTimestamp,\\n int224[] memory beaconValues,\\n uint32[] memory beaconTimestamps\\n );\\n\\n function subscriptionIdToUpdateParameters(\\n bytes32 subscriptionId\\n ) external view returns (bytes memory updateParameters);\\n\\n function MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH()\\n external\\n view\\n returns (uint256);\\n\\n function DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE()\\n external\\n view\\n returns (bytes32);\\n\\n function DAPI_PRICING_MERKLE_ROOT_HASH_TYPE()\\n external\\n view\\n returns (bytes32);\\n\\n function SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE()\\n external\\n view\\n returns (bytes32);\\n\\n function MAXIMUM_DAPI_UPDATE_AGE() external view returns (uint256);\\n\\n function api3ServerV1() external view returns (address);\\n\\n function proxyFactory() external view returns (address);\\n\\n function airseekerRegistry() external view returns (address);\\n\\n function subscriptions(\\n bytes32 subscriptionId\\n )\\n external\\n view\\n returns (\\n bytes32 updateParametersHash,\\n uint32 endTimestamp,\\n uint224 dailyPrice,\\n bytes32 nextSubscriptionId\\n );\\n\\n function dapiNameToCurrentSubscriptionId(\\n bytes32 dapiName\\n ) external view returns (bytes32 currentSubscriptionId);\\n}\\n\",\"keccak256\":\"0xf9f412320bd00214517120bbd101cdd6ef62c590f317436985fba3e2c0aad3f8\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDapiServer.sol\\\";\\nimport \\\"./IBeaconUpdatesWithSignedData.sol\\\";\\n\\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n}\\n\",\"keccak256\":\"0xea2c05eaf2a19c93a9c9b08243fcabd8d7fcf0e4d422f7c687aef693126c1809\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n}\\n\",\"keccak256\":\"0xe2b2530081508baf1323d4c145a688ffd548cf318a8cb67c9ccb4abe1ac81c6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IDapiServer is\\n IAccessControlRegistryAdminnedWithManager,\\n IDataFeedServer\\n{\\n event SetDapiName(\\n bytes32 indexed dataFeedId,\\n bytes32 indexed dapiName,\\n address sender\\n );\\n\\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\\n\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view returns (bytes32);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function dapiNameSetterRole() external view returns (bytes32);\\n\\n function dapiNameHashToDataFeedId(\\n bytes32 dapiNameHash\\n ) external view returns (bytes32 dataFeedId);\\n}\\n\",\"keccak256\":\"0x1cf1d7637e2ee1b4f5b99345730183447db78ceb8ce2117cf145d4d375194e71\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IDataFeedServer is IExtendedSelfMulticall {\\n event UpdatedBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedBeaconSetWithBeacons(\\n bytes32 indexed beaconSetId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) external returns (bytes32 beaconSetId);\\n}\\n\",\"keccak256\":\"0x208f751f71b16d454cafd9188095178fdc776ee0376a85362f6022e7a4f010a3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDataFeedServer.sol\\\";\\nimport \\\"./IDapiServer.sol\\\";\\n\\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\\n\",\"keccak256\":\"0xf4082c33979785131358a217a8c5cf498a53c04318868eb1cb68e934c33226e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IOevDataFeedServer is IDataFeedServer {\\n event UpdatedOevProxyBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedOevProxyBeaconSetWithSignedData(\\n bytes32 indexed beaconSetId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event Withdrew(\\n address indexed oevProxy,\\n address oevBeneficiary,\\n uint256 amount\\n );\\n\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable;\\n\\n function withdraw(address oevProxy) external;\\n\\n function oevProxyToBalance(\\n address oevProxy\\n ) external view returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x2d162c576bfe5554767bb48758314c3e6f2c509f73203f0e166d1ac5168a1218\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IProxyFactory {\\n event DeployedDataFeedProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n bytes metadata\\n );\\n\\n event DeployedDataFeedProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n function deployDataFeedProxy(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDataFeedProxyWithOev(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function computeDataFeedProxyAddress(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyAddress(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDataFeedProxyWithOevAddress(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyWithOevAddress(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function api3ServerV1() external view returns (address);\\n}\\n\",\"keccak256\":\"0x60b3b838b94ead5e5760a897053236ce20954a616a6892c7088ad1cf851290a1\",\"license\":\"MIT\"},\"contracts/utils/ExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"./SelfMulticall.sol\\\";\\nimport \\\"./interfaces/IExtendedSelfMulticall.sol\\\";\\n\\n/// @title Contract that extends SelfMulticall to fetch some of the global\\n/// variables\\n/// @notice Available global variables are limited to the ones that Airnode\\n/// tends to need\\ncontract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {\\n /// @notice Returns the chain ID\\n /// @return Chain ID\\n function getChainId() external view override returns (uint256) {\\n return block.chainid;\\n }\\n\\n /// @notice Returns the account balance\\n /// @param account Account address\\n /// @return Account balance\\n function getBalance(\\n address account\\n ) external view override returns (uint256) {\\n return account.balance;\\n }\\n\\n /// @notice Returns if the account contains bytecode\\n /// @dev An account not containing any bytecode does not indicate that it\\n /// is an EOA or it will not contain any bytecode in the future.\\n /// Contract construction and `SELFDESTRUCT` updates the bytecode at the\\n /// end of the transaction.\\n /// @return If the account contains bytecode\\n function containsBytecode(\\n address account\\n ) external view override returns (bool) {\\n return account.code.length > 0;\\n }\\n\\n /// @notice Returns the current block number\\n /// @return Current block number\\n function getBlockNumber() external view override returns (uint256) {\\n return block.number;\\n }\\n\\n /// @notice Returns the current block timestamp\\n /// @return Current block timestamp\\n function getBlockTimestamp() external view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /// @notice Returns the current block basefee\\n /// @return Current block basefee\\n function getBlockBasefee() external view override returns (uint256) {\\n return block.basefee;\\n }\\n}\\n\",\"keccak256\":\"0xada4020386f51e076953a110accf21efc53b82858bb88fc6725591556d86574b\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISelfMulticall.sol\\\";\\n\\ninterface IExtendedSelfMulticall is ISelfMulticall {\\n function getChainId() external view returns (uint256);\\n\\n function getBalance(address account) external view returns (uint256);\\n\\n function containsBytecode(address account) external view returns (bool);\\n\\n function getBlockNumber() external view returns (uint256);\\n\\n function getBlockTimestamp() external view returns (uint256);\\n\\n function getBlockBasefee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xaefe61a623c920d3e39c4779535e280378b44202d11c29a2c96f46f2fe5f420d\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling 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\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (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 function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\nimport \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toString(int256 value) internal pure returns (string memory) {\\n return string(abi.encodePacked(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value))));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\")\\n mstore(0x1c, hash)\\n message := keccak256(0x00, 0x3c)\\n }\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, \\\"\\\\x19\\\\x01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n data := keccak256(ptr, 0x42)\\n }\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\\n * `validator` and `data` according to the version 0 of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x00\\\", validator, data));\\n }\\n}\\n\",\"keccak256\":\"0x809bc3edb4bcbef8263fa616c1b60ee0004b50a8a1bfa164d8f57fd31f520c58\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/MerkleProof.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev These functions deal with verification of Merkle Tree proofs.\\n *\\n * The tree and the proofs can be generated using our\\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\\n * You will find a quickstart guide in the readme.\\n *\\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\\n * hashing, or use a hash function other than keccak256 for hashing leaves.\\n * This is because the concatenation of a sorted pair of internal nodes in\\n * the merkle tree could be reinterpreted as a leaf value.\\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\\n * against this attack out of the box.\\n */\\nlibrary MerkleProof {\\n /**\\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\\n * defined by `root`. For this, a `proof` must be provided, containing\\n * sibling hashes on the branch from the leaf to the root of the tree. Each\\n * pair of leaves and each pair of pre-images are assumed to be sorted.\\n */\\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\\n return processProof(proof, leaf) == root;\\n }\\n\\n /**\\n * @dev Calldata version of {verify}\\n *\\n * _Available since v4.7._\\n */\\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\\n return processProofCalldata(proof, leaf) == root;\\n }\\n\\n /**\\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\\n * hash matches the root of the tree. When processing the proof, the pairs\\n * of leafs & pre-images are assumed to be sorted.\\n *\\n * _Available since v4.4._\\n */\\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\\n bytes32 computedHash = leaf;\\n for (uint256 i = 0; i < proof.length; i++) {\\n computedHash = _hashPair(computedHash, proof[i]);\\n }\\n return computedHash;\\n }\\n\\n /**\\n * @dev Calldata version of {processProof}\\n *\\n * _Available since v4.7._\\n */\\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\\n bytes32 computedHash = leaf;\\n for (uint256 i = 0; i < proof.length; i++) {\\n computedHash = _hashPair(computedHash, proof[i]);\\n }\\n return computedHash;\\n }\\n\\n /**\\n * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\\n *\\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\\n *\\n * _Available since v4.7._\\n */\\n function multiProofVerify(\\n bytes32[] memory proof,\\n bool[] memory proofFlags,\\n bytes32 root,\\n bytes32[] memory leaves\\n ) internal pure returns (bool) {\\n return processMultiProof(proof, proofFlags, leaves) == root;\\n }\\n\\n /**\\n * @dev Calldata version of {multiProofVerify}\\n *\\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\\n *\\n * _Available since v4.7._\\n */\\n function multiProofVerifyCalldata(\\n bytes32[] calldata proof,\\n bool[] calldata proofFlags,\\n bytes32 root,\\n bytes32[] memory leaves\\n ) internal pure returns (bool) {\\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\\n }\\n\\n /**\\n * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\\n * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\\n * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\\n * respectively.\\n *\\n * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\\n * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\\n * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\\n *\\n * _Available since v4.7._\\n */\\n function processMultiProof(\\n bytes32[] memory proof,\\n bool[] memory proofFlags,\\n bytes32[] memory leaves\\n ) internal pure returns (bytes32 merkleRoot) {\\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\\n // the merkle tree.\\n uint256 leavesLen = leaves.length;\\n uint256 proofLen = proof.length;\\n uint256 totalHashes = proofFlags.length;\\n\\n // Check proof validity.\\n require(leavesLen + proofLen - 1 == totalHashes, \\\"MerkleProof: invalid multiproof\\\");\\n\\n // The xxxPos values are \\\"pointers\\\" to the next value to consume in each array. All accesses are done using\\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \\\"pop\\\".\\n bytes32[] memory hashes = new bytes32[](totalHashes);\\n uint256 leafPos = 0;\\n uint256 hashPos = 0;\\n uint256 proofPos = 0;\\n // At each step, we compute the next hash using two values:\\n // - a value from the \\\"main queue\\\". If not all leaves have been consumed, we get the next leaf, otherwise we\\n // get the next hash.\\n // - depending on the flag, either another value from the \\\"main queue\\\" (merging branches) or an element from the\\n // `proof` array.\\n for (uint256 i = 0; i < totalHashes; i++) {\\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\\n bytes32 b = proofFlags[i]\\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\\n : proof[proofPos++];\\n hashes[i] = _hashPair(a, b);\\n }\\n\\n if (totalHashes > 0) {\\n require(proofPos == proofLen, \\\"MerkleProof: invalid multiproof\\\");\\n unchecked {\\n return hashes[totalHashes - 1];\\n }\\n } else if (leavesLen > 0) {\\n return leaves[0];\\n } else {\\n return proof[0];\\n }\\n }\\n\\n /**\\n * @dev Calldata version of {processMultiProof}.\\n *\\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\\n *\\n * _Available since v4.7._\\n */\\n function processMultiProofCalldata(\\n bytes32[] calldata proof,\\n bool[] calldata proofFlags,\\n bytes32[] memory leaves\\n ) internal pure returns (bytes32 merkleRoot) {\\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\\n // the merkle tree.\\n uint256 leavesLen = leaves.length;\\n uint256 proofLen = proof.length;\\n uint256 totalHashes = proofFlags.length;\\n\\n // Check proof validity.\\n require(leavesLen + proofLen - 1 == totalHashes, \\\"MerkleProof: invalid multiproof\\\");\\n\\n // The xxxPos values are \\\"pointers\\\" to the next value to consume in each array. All accesses are done using\\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \\\"pop\\\".\\n bytes32[] memory hashes = new bytes32[](totalHashes);\\n uint256 leafPos = 0;\\n uint256 hashPos = 0;\\n uint256 proofPos = 0;\\n // At each step, we compute the next hash using two values:\\n // - a value from the \\\"main queue\\\". If not all leaves have been consumed, we get the next leaf, otherwise we\\n // get the next hash.\\n // - depending on the flag, either another value from the \\\"main queue\\\" (merging branches) or an element from the\\n // `proof` array.\\n for (uint256 i = 0; i < totalHashes; i++) {\\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\\n bytes32 b = proofFlags[i]\\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\\n : proof[proofPos++];\\n hashes[i] = _hashPair(a, b);\\n }\\n\\n if (totalHashes > 0) {\\n require(proofPos == proofLen, \\\"MerkleProof: invalid multiproof\\\");\\n unchecked {\\n return hashes[totalHashes - 1];\\n }\\n } else if (leavesLen > 0) {\\n return leaves[0];\\n } else {\\n return proof[0];\\n }\\n }\\n\\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\\n }\\n\\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0x00, a)\\n mstore(0x20, b)\\n value := keccak256(0x00, 0x40)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n require(value <= type(uint248).max, \\\"SafeCast: value doesn't fit in 248 bits\\\");\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n require(value <= type(uint240).max, \\\"SafeCast: value doesn't fit in 240 bits\\\");\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n require(value <= type(uint232).max, \\\"SafeCast: value doesn't fit in 232 bits\\\");\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n *\\n * _Available since v4.2._\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n require(value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n require(value <= type(uint216).max, \\\"SafeCast: value doesn't fit in 216 bits\\\");\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n require(value <= type(uint208).max, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n require(value <= type(uint200).max, \\\"SafeCast: value doesn't fit in 200 bits\\\");\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n require(value <= type(uint192).max, \\\"SafeCast: value doesn't fit in 192 bits\\\");\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n require(value <= type(uint184).max, \\\"SafeCast: value doesn't fit in 184 bits\\\");\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n require(value <= type(uint176).max, \\\"SafeCast: value doesn't fit in 176 bits\\\");\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n require(value <= type(uint168).max, \\\"SafeCast: value doesn't fit in 168 bits\\\");\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n require(value <= type(uint160).max, \\\"SafeCast: value doesn't fit in 160 bits\\\");\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n require(value <= type(uint152).max, \\\"SafeCast: value doesn't fit in 152 bits\\\");\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n require(value <= type(uint144).max, \\\"SafeCast: value doesn't fit in 144 bits\\\");\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n require(value <= type(uint136).max, \\\"SafeCast: value doesn't fit in 136 bits\\\");\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n require(value <= type(uint128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n require(value <= type(uint120).max, \\\"SafeCast: value doesn't fit in 120 bits\\\");\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n require(value <= type(uint112).max, \\\"SafeCast: value doesn't fit in 112 bits\\\");\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n require(value <= type(uint104).max, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n *\\n * _Available since v4.2._\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n require(value <= type(uint96).max, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n require(value <= type(uint88).max, \\\"SafeCast: value doesn't fit in 88 bits\\\");\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n require(value <= type(uint80).max, \\\"SafeCast: value doesn't fit in 80 bits\\\");\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n require(value <= type(uint72).max, \\\"SafeCast: value doesn't fit in 72 bits\\\");\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n require(value <= type(uint64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n require(value <= type(uint56).max, \\\"SafeCast: value doesn't fit in 56 bits\\\");\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n require(value <= type(uint48).max, \\\"SafeCast: value doesn't fit in 48 bits\\\");\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n require(value <= type(uint40).max, \\\"SafeCast: value doesn't fit in 40 bits\\\");\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n require(value <= type(uint32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n require(value <= type(uint24).max, \\\"SafeCast: value doesn't fit in 24 bits\\\");\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n require(value <= type(uint16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n require(value <= type(uint8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n *\\n * _Available since v3.0._\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 248 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 240 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 232 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 216 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 200 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 192 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 184 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 176 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 168 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 160 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 152 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 144 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 136 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 120 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 112 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 88 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 80 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 72 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 56 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 48 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 40 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 24 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n *\\n * _Available since v3.0._\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n require(value <= uint256(type(int256).max), \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0x52a8cfb0f5239d11b457dcdd1b326992ef672714ca8da71a157255bddd13f3ad\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // must be unchecked in order to support `n = type(int256).min`\\n return uint256(n >= 0 ? n : -n);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.9.5/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x9f4357008a8f7d8c8bf5d48902e789637538d8c016be5766610901b4bba81514\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b50604051620083253803806200832583398101604081905262000034916200020c565b81620000403362000191565b6001600160a01b038116620000905760405162461bcd60e51b81526020600482015260126024820152714f776e65722061646472657373207a65726f60701b604482015260640160405180910390fd5b6200009b8162000191565b50806001600160a01b031660a0816001600160a01b0316815250506000816001600160a01b0316632d6a744e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000f7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011d919062000244565b6001600160a01b038116608052604051909150600090309083906200014290620001e1565b6001600160a01b039283168152911660208201526040018190604051809103906000f59050801580156200017a573d6000803e3d6000fd5b506001600160a01b031660c0525062000269915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612c7c80620056a983390190565b80516001600160a01b03811681146200020757600080fd5b919050565b600080604083850312156200022057600080fd5b6200022b83620001ef565b91506200023b60208401620001ef565b90509250929050565b6000602082840312156200025757600080fd5b6200026282620001ef565b9392505050565b60805160a05160c051615376620003336000396000818161050001528181610e6201528181610f9d015281816112d9015281816124a401528181612ce701528181612d5201528181613708015281816137a00152613acb0152600081816107a6015281816111ee01526114f00152600081816103de0152818161098f01528181610d8d01528181611e490152818161254e0152818161262c0152818161280f01528181612a9801528181612bca015281816138610152818161393801526139c401526153766000f3fe6080604052600436106102d05760003560e01c8063796b89b911610179578063c1516e54116100d6578063d7fecd8c1161008a578063f2fde38b11610064578063f2fde38b146108f5578063f8b2cb4f14610915578063fa0130671461093d57600080fd5b8063d7fecd8c1461089a578063d8d2f90f146108ad578063e637cf00146108de57600080fd5b8063d5659f31116100bb578063d5659f311461081c578063d658d2e914610831578063d7fa10071461087a57600080fd5b8063c1516e54146107c8578063c6c04e16146107e857600080fd5b80639ae06c841161012d578063aa2b44e411610112578063aa2b44e41461073a578063ac9650d814610767578063c10f1a751461079457600080fd5b80639ae06c84146106fa578063a5f36cb11461071a57600080fd5b80638c9f4c791161015e5780638c9f4c79146106265780638da5cb5b1461065357806394259c6c1461067157600080fd5b8063796b89b9146105e6578063845ebe43146105f957600080fd5b80633adb35fe116102325780635849e5ef116101e65780635d868194116101c05780635d8681941461059157806364c2359d146105b1578063715018a6146105d157600080fd5b80635849e5ef146105225780635885c771146105425780635989eaeb1461055757600080fd5b8063437b911611610217578063437b9116146104ad5780634dcc19fe146104db57806353130e26146104ee57600080fd5b80633adb35fe1461044057806342cbb15c1461049a57600080fd5b80631d911b6d116102895780632d6a744e1161026e5780632d6a744e146103cc5780633408e4701461041857806336dff6531461042b57600080fd5b80631d911b6d14610397578063288ddb61146103b757600080fd5b8063044c9bd7116102ba578063044c9bd71461032a57806318d6e2d4146103575780631a0a0b3e1461037757600080fd5b8062aae33f146102d55780630141ff4814610308575b600080fd5b3480156102e157600080fd5b506102f56102f0366004614100565b61095d565b6040519081526020015b60405180910390f35b34801561031457600080fd5b50610328610323366004614142565b610a11565b005b34801561033657600080fd5b506102f5610345366004614142565b60009081526001602052604090205490565b34801561036357600080fd5b5061032861037236600461415b565b610ae9565b34801561038357600080fd5b506102f56103923660046141fe565b610d5a565b3480156103a357600080fd5b506103286103b2366004614294565b610e1d565b3480156103c357600080fd5b506102f561100f565b3480156103d857600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102ff565b34801561042457600080fd5b50466102f5565b34801561043757600080fd5b506102f5600581565b34801561044c57600080fd5b506102f56040517f417069334d61726b6574207369676e61747572652064656c65676174696f6e006020820152600090603f0160405160208183030381529060405280519060200120905090565b3480156104a657600080fd5b50436102f5565b3480156104b957600080fd5b506104cd6104c8366004614100565b611055565b6040516102ff9291906143bf565b3480156104e757600080fd5b50486102f5565b3480156104fa57600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b34801561052e57600080fd5b5061040061053d366004614418565b6111bb565b34801561054e57600080fd5b506102f5611275565b34801561056357600080fd5b50610581610572366004614474565b6001600160a01b03163b151590565b60405190151581526020016102ff565b34801561059d57600080fd5b506102f56105ac366004614491565b6112a6565b3480156105bd57600080fd5b506102f56105cc366004614142565b611310565b3480156105dd57600080fd5b506103286113c6565b3480156105f257600080fd5b50426102f5565b34801561060557600080fd5b506102f5610614366004614142565b60026020526000908152604090205481565b34801561063257600080fd5b50610646610641366004614142565b61140e565b6040516102ff91906144c7565b34801561065f57600080fd5b506000546001600160a01b0316610400565b34801561067d57600080fd5b506106c761068c366004614142565b600360205260009081526040902080546001820154600290920154909163ffffffff8116916401000000009091046001600160e01b03169084565b6040805194855263ffffffff90931660208501526001600160e01b039091169183019190915260608201526080016102ff565b34801561070657600080fd5b506104006107153660046144da565b6114bd565b34801561072657600080fd5b50610328610735366004614519565b611574565b34801561074657600080fd5b506102f5610755366004614142565b60046020526000908152604090205481565b34801561077357600080fd5b50610787610782366004614100565b611b0b565b6040516102ff9190614569565b3480156107a057600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b3480156107d457600080fd5b506102f56107e336600461457c565b611c8c565b3480156107f457600080fd5b50610808610803366004614142565b611e38565b6040516102ff98979695949392919061464e565b34801561082857600080fd5b506102f56121bd565b34801561083d57600080fd5b5061086561084c366004614142565b6001602081905260009182526040909120805491015482565b604080519283526020830191909152016102ff565b34801561088657600080fd5b50610328610895366004614719565b6121ee565b6102f56108a836600461474b565b61225f565b3480156108b957600080fd5b506108cd6108c8366004614142565b61249a565b6040516102ff959493929190614823565b3480156108ea57600080fd5b506102f56201518081565b34801561090157600080fd5b50610328610910366004614474565b612987565b34801561092157600080fd5b506102f5610930366004614474565b6001600160a01b03163190565b34801561094957600080fd5b50610328610958366004614871565b6129cf565b6040517eaae33f0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169062aae33f906109c590869086906004016148ca565b6020604051808303816000875af11580156109e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a08919061491c565b90505b92915050565b60008181526004602052604090205480610a725760405162461bcd60e51b815260206004820152601860248201527f537562736372697074696f6e20717565756520656d707479000000000000000060448201526064015b60405180910390fd5b6000818152600360205260409020600101544263ffffffff9091161115610adb5760405162461bcd60e51b815260206004820152601e60248201527f43757272656e7420737562736372697074696f6e206e6f7420656e64656400006044820152606401610a69565b610ae58282612c36565b5050565b610af1612da6565b82610b3e5760405162461bcd60e51b815260206004820152600e60248201527f486173682074797065207a65726f0000000000000000000000000000000000006044820152606401610a69565b806000819003610b905760405162461bcd60e51b815260206004820152600d60248201527f5369676e65727320656d707479000000000000000000000000000000000000006044820152606401610a69565b600083838281610ba257610ba2614935565b9050602002016020810190610bb79190614474565b6001600160a01b031603610c0d5760405162461bcd60e51b815260206004820152601960248201527f4669727374207369676e65722061646472657373207a65726f000000000000006044820152606401610a69565b60015b81811015610ce1578383610c25600184614961565b818110610c3457610c34614935565b9050602002016020810190610c499190614474565b6001600160a01b0316848483818110610c6457610c64614935565b9050602002016020810190610c799190614474565b6001600160a01b031611610ccf5760405162461bcd60e51b815260206004820152601e60248201527f5369676e657273206e6f7420696e20617363656e64696e67206f7264657200006044820152606401610a69565b80610cd981614974565b915050610c10565b508282604051602001610cf592919061498d565b60408051601f198184030181528282528051602091820120600088815260029092529190205584907f5a1f5ee4ceedd78b1982374b4790e8aa9f31e8af1c32aaef46b2afd8a789193a90610d4c90869086906149cf565b60405180910390a250505050565b6040517f1a0a0b3e0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631a0a0b3e90610dce908b908b908b908b908b908b908b90600401614a46565b6020604051808303816000875af1158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e11919061491c565b98975050505050505050565b610e2a8585858585612e11565b6040517f085df6ab0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063085df6ab90602401600060405180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed19190810190614b3a565b604051602001610ee19190614b83565b604051602081830303815290604052805190602001208484604051602001610f0a929190614b9f565b6040516020818303038152906040528051906020012003610f6d5760405162461bcd60e51b815260206004820152601e60248201527f446f6573206e6f7420757064617465207369676e6564204150492055524c00006044820152606401610a69565b6040517ffba8f22f0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063fba8f22f90610fd690889088908890600401614baf565b600060405180830381600087803b158015610ff057600080fd5b505af1158015611004573d6000803e3d6000fd5b505050505050505050565b6040517f644150492070726963696e67204d65726b6c6520726f6f74000000000000000060208201526038015b6040516020818303038152906040528051906020012081565b606080828067ffffffffffffffff81111561107257611072614a96565b60405190808252806020026020018201604052801561109b578160200160208202803683370190505b5092508067ffffffffffffffff8111156110b7576110b7614a96565b6040519080825280602002602001820160405280156110ea57816020015b60608152602001906001900390816110d55790505b50915060005b818110156111b2573086868381811061110b5761110b614935565b905060200281019061111d9190614bd2565b60405161112b929190614b9f565b600060405180830381855af49150503d8060008114611166576040519150601f19603f3d011682016040523d82523d6000602084013e61116b565b606091505b5085838151811061117e5761117e614935565b6020026020010185848151811061119757611197614935565b602090810291909101019190915290151590526001016110f0565b50509250929050565b6040517f5849e5ef0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635849e5ef90611229908890889088908890600401614c19565b6020604051808303816000875af1158015611248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126c9190614c42565b95945050505050565b6040517f64415049206d616e6167656d656e74204d65726b6c6520726f6f7400000000006020820152603b0161103c565b6040517f5d8681940000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635d868194906109c59086908690600401614c5f565b60008061131c42612f57565b600084815260046020526040812054919250905b80156113be576000818152600360205260409020600181015490925063ffffffff16428111156113b2576001830154620151809064010000000090046001600160e01b031661137f8684614c73565b63ffffffff1661138f9190614c97565b6113999190614cdf565b6113ac906001600160e01b031686614d05565b94508093505b50506002810154611330565b505050919050565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e6365640000006044820152606401610a69565b60008181526003602090815260408083205483526005909152902080546060919061143890614d18565b80601f016020809104026020016040519081016040528092919081815260200182805461146490614d18565b80156114b15780601f10611486576101008083540402835291602001916114b1565b820191906000526020600020905b81548152906001019060200180831161149457829003601f168201915b50505050509050919050565b6040517f9ae06c840000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639ae06c849061152990879087908790600401614d52565b6020604051808303816000875af1158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c9190614c42565b949350505050565b836115c15760405162461bcd60e51b815260206004820152600f60248201527f486173682076616c7565207a65726f00000000000000000000000000000000006044820152606401610a69565b428311156116115760405162461bcd60e51b815260206004820152601a60248201527f486173682074696d657374616d702066726f6d206675747572650000000000006044820152606401610a69565b6000858152600160208190526040909120015483116116725760405162461bcd60e51b815260206004820152601e60248201527f486173682074696d657374616d70206e6f74206d6f726520726563656e7400006044820152606401610a69565b600085815260026020526040902054806116ce5760405162461bcd60e51b815260206004820152600f60248201527f5369676e657273206e6f742073657400000000000000000000000000000000006044820152606401610a69565b8160008167ffffffffffffffff8111156116ea576116ea614a96565b604051908082528060200260200182016040528015611713578160200160208202803683370190505b5060408051602081018b905290810189905260608101889052909150600090611783906080015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060005b83811015611a1d5760008787838181106117a4576117a4614935565b90506020028101906117b69190614bd2565b915050604019810161185b57611824838989858181106117d8576117d8614935565b90506020028101906117ea9190614bd2565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fd792505050565b84838151811061183657611836614935565b60200260200101906001600160a01b031690816001600160a01b031681525050611a0a565b61016081036119c25760008060008a8a8681811061187b5761187b614935565b905060200281019061188d9190614bd2565b81019061189a9190614dbd565b9250925092508242106118ef5760405162461bcd60e51b815260206004820152601060248201527f44656c65676174696f6e20656e646564000000000000000000000000000000006044820152606401610a69565b6119886119826119426040517f417069334d61726b6574207369676e61747572652064656c65676174696f6e006020820152600090603f0160405160208183030381529060405280519060200120905090565b61194c8985612fd7565b8660405160200161173a9392919092835260609190911b6bffffffffffffffffffffffff19166020830152603482015260540190565b83612fd7565b87868151811061199a5761199a614935565b60200260200101906001600160a01b031690816001600160a01b031681525050505050611a0a565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610a69565b5080611a1581614974565b915050611788565b5081604051602001611a2f9190614e2a565b604051602081830303815290604052805190602001208414611a935760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610a69565b60408051808201825289815260208082018a815260008d815260019283905284902092518355519101555189907fa33e8931ee2a869317bbe04201dab2907fd39d2d7f014c15b8459986e62c279190611af8908b908b90918252602082015260400190565b60405180910390a2505050505050505050565b6060818067ffffffffffffffff811115611b2757611b27614a96565b604051908082528060200260200182016040528015611b5a57816020015b6060815260200190600190039081611b455790505b50915060005b81811015611c8457600030868684818110611b7d57611b7d614935565b9050602002810190611b8f9190614bd2565b604051611b9d929190614b9f565b600060405180830381855af49150503d8060008114611bd8576040519150601f19603f3d011682016040523d82523d6000602084013e611bdd565b606091505b50858481518110611bf057611bf0614935565b6020908102919091010152905080611c7b576000848381518110611c1657611c16614935565b60200260200101519050600081511115611c335780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610a69565b50600101611b60565b505092915050565b600060608414611cde5760405162461bcd60e51b815260206004820181905260248201527f55706461746520706172616d6574657273206c656e67746820696e76616c69646044820152606401610a69565b600080600080611cf08a8a8a8a612ffb565b93509350935093506000878762015180611d0a9190614e69565b611d149190614e80565b90506000611d2142612f57565b905060008415611d3f5760008d815260046020526040902054611d41565b865b90505b8015611e2857868103611d91576201518083611d608489614c73565b63ffffffff16611d709190614e69565b611d7a9190614e80565b611d849089614d05565b9750859150839050611d44565b6000818152600360205260409020600181015463ffffffff1642811115611e0a576001820154620151809064010000000090046001600160e01b0316611dd78684614c73565b63ffffffff16611de79190614c97565b611df19190614cdf565b611e04906001600160e01b03168b614d05565b99508093505b828703611e1957889250611e21565b816002015492505b5050611d44565b5050505050505095945050505050565b6060600080606080606080606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f18b604051602001611e8991815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611ebd91815260200190565b602060405180830381865afa158015611eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efe919061491c565b9050611f098161249a565b60008f815260046020526040812054959e50939c50919a5098509650905b8015611f545781611f3781614974565b60009283526003602052604090922060020154919250611f279050565b508067ffffffffffffffff811115611f6e57611f6e614a96565b604051908082528060200260200182016040528015611fa157816020015b6060815260200190600190039081611f8c5790505b5094508067ffffffffffffffff811115611fbd57611fbd614a96565b604051908082528060200260200182016040528015611fe6578160200160208202803683370190505b5093508067ffffffffffffffff81111561200257612002614a96565b60405190808252806020026020018201604052801561202b578160200160208202803683370190505b5060008c8152600460209081526040808320548352600390915281209194505b828110156121ae5781546000908152600560205260409020805461206e90614d18565b80601f016020809104026020016040519081016040528092919081815260200182805461209a90614d18565b80156120e75780601f106120bc576101008083540402835291602001916120e7565b820191906000526020600020905b8154815290600101906020018083116120ca57829003601f168201915b50505050508782815181106120fe576120fe614935565b60209081029190910101526001820154865163ffffffff9091169087908390811061212b5761212b614935565b602002602001019063ffffffff16908163ffffffff16815250508160010160049054906101000a90046001600160e01b031685828151811061216f5761216f614935565b6001600160e01b0390921660209283029190910182015260029092015460009081526003909252604090912090806121a681614974565b91505061204b565b50505050919395975091939597565b6040517f5369676e6564204150492055524c204d65726b6c6520726f6f740000000000006020820152603a0161103c565b6121f6612da6565b604080518082018252828152426020808301828152600087815260018084529086902094518555905193019290925582518481529182015283917f19cb5bc6996c2541fb44252778e9c8c952662cce4670a75a4174b50c765bd7d1910160405180910390a25050565b60008a6122ae5760405162461bcd60e51b815260206004820152601160248201527f446174612066656564204944207a65726f0000000000000000000000000000006044820152606401610a69565b6001600160a01b038a166123045760405162461bcd60e51b815260206004820152601b60248201527f53706f6e736f722077616c6c65742061646472657373207a65726f00000000006044820152606401610a69565b6123118c8c8c8c8c61324d565b6123208c888888888888613379565b61232e8c8c89898989613574565b90506123398c611310565b61234d346001600160a01b038d1631614d05565b101561239b5760405162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74207061796d656e740000000000000000000000006044820152606401610a69565b808c7fd44e8abecc305a9434d27a049c731a8331cee8bca6496154f47835b396ce55068d8d8b8b8b8b346040516123d89796959493929190614e94565b60405180910390a3341561248b5760008a6001600160a01b03163460405160006040518083038185875af1925050503d8060008114612433576040519150601f19603f3d011682016040523d82523d6000602084013e612438565b606091505b50509050806124895760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c00000000000000000000006044820152606401610a69565b505b9b9a5050505050505050505050565b60606000806060807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e85b69a876040518263ffffffff1660e01b81526004016124f091815260200190565b600060405180830381865afa15801561250d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125359190810190614b3a565b6040516367a7cfb760e01b8152600481018890529095507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906367a7cfb7906024016040805180830381865afa15801561259c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c09190614eeb565b86519195509350603f190161275a5760408051600180825281830190925290602080830190803683375050604080516001808252818301909252929450905060208083019080368337019050509050600080868060200190518101906126269190614f2e565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb76126a584846040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6040518263ffffffff1660e01b81526004016126c391815260200190565b6040805180830381865afa1580156126df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127039190614eeb565b8560008151811061271657612716614935565b602002602001018560008151811061273057612730614935565b602002602001018263ffffffff1663ffffffff1681525082601b0b601b0b8152505050505061297e565b600080868060200190518101906127719190614fdb565b815191935091508067ffffffffffffffff81111561279157612791614a96565b6040519080825280602002602001820160405280156127ba578160200160208202803683370190505b5094508067ffffffffffffffff8111156127d6576127d6614a96565b6040519080825280602002602001820160405280156127ff578160200160208202803683370190505b50935060005b81811015612979577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb76128ba86848151811061285157612851614935565b602002602001015186858151811061286b5761286b614935565b60200260200101516040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6040518263ffffffff1660e01b81526004016128d891815260200190565b6040805180830381865afa1580156128f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129189190614eeb565b87838151811061292a5761292a614935565b6020026020010187848151811061294357612943614935565b602002602001018263ffffffff1663ffffffff1681525082601b0b601b0b8152505050808061297190614974565b915050612805565b505050505b91939590929450565b60405162461bcd60e51b815260206004820152601f60248201527f4f776e6572736869702063616e6e6f74206265207472616e73666572726564006044820152606401610a69565b8315612a30576001600160a01b038316612a2b5760405162461bcd60e51b815260206004820152601b60248201527f53706f6e736f722077616c6c65742061646472657373207a65726f00000000006044820152606401610a69565b612a87565b6001600160a01b03831615612a875760405162461bcd60e51b815260206004820152601f60248201527f53706f6e736f722077616c6c65742061646472657373206e6f74207a65726f006044820152606401610a69565b612a94858585858561324d565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f187604051602001612ad891815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612b0c91815260200190565b602060405180830381865afa158015612b29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4d919061491c565b9050848103612b9e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652064415049206e616d65000000000000006044820152606401610a69565b8415612bad57612bad856139ab565b6040516391eed08560e01b815260048101879052602481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391eed08590604401600060405180830381600087803b158015612c1657600080fd5b505af1158015612c2a573d6000803e3d6000fd5b50505050505050505050565b5b6000908152600360205260409020600201548015801590612c7157506000818152600360205260409020600101544263ffffffff90911611155b612c3757604051819083907fe08aff0930a0c84c077d2ce7e690a3f910c0f8705376b2405816efb89b9869b790600090a3600082815260046020526040902081905580612d50576040517f2412a9cb000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632412a9cb906024015b600060405180830381600087803b158015612d3457600080fd5b505af1158015612d48573d6000803e3d6000fd5b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d23bab1483612d898461140e565b6040518363ffffffff1660e01b8152600401612d1a9291906150a0565b33612db96000546001600160a01b031690565b6001600160a01b031614612e0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a69565b565b600080612e20838501856150b9565b915091508160016000604051602001612e5c907f5369676e6564204150492055524c204d65726b6c6520726f6f740000000000008152601a0190565b6040516020818303038152906040528051906020012081526020019081526020016000206000015414612ec05760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b612f128183898989604051602001612eda93929190614baf565b60408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120613b8a565b612f4e5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610a69565b50505050505050565b600063ffffffff821115612fd35760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610a69565b5090565b6000806000612fe68585613ba2565b91509150612ff381613be7565b509392505050565b600080600080878787604051613012929190614b9f565b6040519081900381206130319291602001918252602082015260400190565b60405160208183030381529060405280519060200120935061305d85426130589190614d05565b612f57565b92506000808061306f898b018b615156565b60008e81526004602052604081205493965091945092509081905b80156131ec57600081815260036020526040812080549093506130b290889088908890613d4f565b60018085015491925063ffffffff909116908260028111156130d6576130d661518e565b14806130ed57508063ffffffff168b63ffffffff16115b6131395760405162461bcd60e51b815260206004820152601d60248201527f537562736372697074696f6e20646f6573206e6f7420757067726164650000006044820152606401610a69565b600282600281111561314d5761314d61518e565b14801561315f5750428163ffffffff16115b1561317657829950848061317290614974565b9550505b600182600281111561318a5761318a61518e565b1480156131a257508063ffffffff168b63ffffffff16105b156131df578298505b82156131d857846131bb81614974565b600094855260036020526040909420600201549395506131ab9050565b50506131ec565b505050600281015461308a565b506005821061323d5760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e2071756575652066756c6c0000000000000000006044820152606401610a69565b5050505050945094509450949050565b8461329a5760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610a69565b6000806132a9838501856150b9565b9150915081600160006040516020016132e5907f64415049206d616e6167656d656e74204d65726b6c6520726f6f7400000000008152601b0190565b60405160208183030381529060405280519060200120815260200190815260200160002060000154146133495760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b60408051602081018990529081018790526001600160a01b0386166060820152612f129082908490608001612eda565b606085146133c95760405162461bcd60e51b815260206004820181905260248201527f55706461746520706172616d6574657273206c656e67746820696e76616c69646044820152606401610a69565b836000036134195760405162461bcd60e51b815260206004820152600d60248201527f4475726174696f6e207a65726f000000000000000000000000000000000000006044820152606401610a69565b826000036134695760405162461bcd60e51b815260206004820152600a60248201527f5072696365207a65726f000000000000000000000000000000000000000000006044820152606401610a69565b600080613478838501856150b9565b9150915081600160006040516020016134b4907f644150492070726963696e67204d65726b6c6520726f6f740000000000000000815260180190565b60405160208183030381529060405280519060200120815260200190815260200160002060000154146135185760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b61353881838b468c8c8c8c604051602001612eda969594939291906151a4565b6110045760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610a69565b6000806000806135868a898989612ffb565b604051939750919550935091506000906135a3908a908a90614b9f565b604051809103902090506005600082815260200190815260200160002080546135cb90614d18565b90506000036135ef5760008181526005602052604090206135ed898b83615224565b505b6040805160808101825282815263ffffffff8616602082015290810161362b8961361c8a62015180614e69565b6136269190614e80565b613f04565b6001600160e01b03908116825260209182018590526000888152600383526040908190208451815592840151908401519091166401000000000263ffffffff9091161760018201556060909101516002909101558261380b5760008b81526004602052604090205485146136d85760405185908c907fe08aff0930a0c84c077d2ce7e690a3f910c0f8705376b2405816efb89b9869b790600090a360008b81526004602052604090208590555b6040517fd23bab140000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d23bab1490613741908e908d908d90600401614d52565b600060405180830381600087803b15801561375b57600080fd5b505af115801561376f573d6000803e3d6000fd5b50506040517fbe3cc74d000000000000000000000000000000000000000000000000000000008152600481018e90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316925063be3cc74d9150602401600060405180830381600087803b1580156137ee57600080fd5b505af1158015613802573d6000803e3d6000fd5b50505050613855565b60008381526003602081815260408084206002018990558e8452600482528084205480855292909152909120600101544263ffffffff90911611613853576138538c82612c36565b505b61385e8a6139ab565b897f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f18d6040516020016138a191815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016138d591815260200190565b602060405180830381865afa1580156138f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613916919061491c565b1461399d576040516391eed08560e01b8152600481018c9052602481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391eed08590604401600060405180830381600087803b15801561398457600080fd5b505af1158015613998573d6000803e3d6000fd5b505050505b505050509695505050505050565b6040516367a7cfb760e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906367a7cfb7906024016040805180830381865afa158015613a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a369190614eeb565b9150613a4d90506201518063ffffffff8316614d05565b421115613a9c5760405162461bcd60e51b815260206004820152601560248201527f4461746120666565642076616c7565207374616c6500000000000000000000006044820152606401610a69565b6040517f7a821819000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a82181990602401602060405180830381865afa158015613b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b3e91906152e5565b610ae55760405162461bcd60e51b815260206004820152601860248201527f446174612066656564206e6f74207265676973746572656400000000000000006044820152606401610a69565b600082613b978584613f83565b1490505b9392505050565b6000808251604103613bd85760208301516040840151606085015160001a613bcc87828585613fc8565b94509450505050613be0565b506000905060025b9250929050565b6000816004811115613bfb57613bfb61518e565b03613c035750565b6001816004811115613c1757613c1761518e565b03613c645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a69565b6002816004811115613c7857613c7861518e565b03613cc55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a69565b6003816004811115613cd957613cd961518e565b03613d4c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610a69565b50565b6000818152600560205260408120805482918291829190613d6f90614d18565b80601f0160208091040260200160405190810160405280929190818152602001828054613d9b90614d18565b8015613de85780601f10613dbd57610100808354040283529160200191613de8565b820191906000526020600020905b815481529060010190602001808311613dcb57829003601f168201915b5050505050806020019051810190613e009190615307565b92509250925081601b0b87601b0b14613e5b5760405162461bcd60e51b815260206004820152601e60248201527f446576696174696f6e207265666572656e636573206e6f7420657175616c00006044820152606401610a69565b8288148015613e6957508086145b15613e7a576000935050505061156c565b828811158015613e8a5750808611155b15613e9b576001935050505061156c565b828810158015613eab5750808610155b15613ebc576002935050505061156c565b60405162461bcd60e51b815260206004820152601e60248201527f55706461746520706172616d657465727320696e636f6d70617261626c6500006044820152606401610a69565b60006001600160e01b03821115612fd35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152608401610a69565b600081815b8451811015612ff357613fb482868381518110613fa757613fa7614935565b602002602001015161408c565b915080613fc081614974565b915050613f88565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613fff5750600090506003614083565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614053573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661407c57600060019250925050614083565b9150600090505b94509492505050565b60008183106140a8576000828152602084905260409020610a08565b6000838152602083905260409020610a08565b60008083601f8401126140cd57600080fd5b50813567ffffffffffffffff8111156140e557600080fd5b6020830191508360208260051b8501011115613be057600080fd5b6000806020838503121561411357600080fd5b823567ffffffffffffffff81111561412a57600080fd5b614136858286016140bb565b90969095509350505050565b60006020828403121561415457600080fd5b5035919050565b60008060006040848603121561417057600080fd5b83359250602084013567ffffffffffffffff81111561418e57600080fd5b61419a868287016140bb565b9497909650939450505050565b6001600160a01b0381168114613d4c57600080fd5b60008083601f8401126141ce57600080fd5b50813567ffffffffffffffff8111156141e657600080fd5b602083019150836020828501011115613be057600080fd5b600080600080600080600060a0888a03121561421957600080fd5b8735614224816141a7565b96506020880135955060408801359450606088013567ffffffffffffffff8082111561424f57600080fd5b61425b8b838c016141bc565b909650945060808a013591508082111561427457600080fd5b506142818a828b016141bc565b989b979a50959850939692959293505050565b6000806000806000606086880312156142ac57600080fd5b85356142b7816141a7565b9450602086013567ffffffffffffffff808211156142d457600080fd5b6142e089838a016141bc565b909650945060408801359150808211156142f957600080fd5b50614306888289016141bc565b969995985093965092949392505050565b60005b8381101561433257818101518382015260200161431a565b50506000910152565b60008151808452614353816020860160208601614317565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b848110156143b257601f198684030189526143a083835161433b565b98840198925090830190600101614384565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b828110156143fa5781511515845292840192908401906001016143dc565b5050508381038285015261440e8186614367565b9695505050505050565b6000806000806060858703121561442e57600080fd5b843593506020850135614440816141a7565b9250604085013567ffffffffffffffff81111561445c57600080fd5b614468878288016141bc565b95989497509550505050565b60006020828403121561448657600080fd5b8135613b9b816141a7565b600080602083850312156144a457600080fd5b823567ffffffffffffffff8111156144bb57600080fd5b614136858286016141bc565b602081526000610a08602083018461433b565b6000806000604084860312156144ef57600080fd5b83359250602084013567ffffffffffffffff81111561450d57600080fd5b61419a868287016141bc565b60008060008060006080868803121561453157600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff81111561455d57600080fd5b614306888289016140bb565b602081526000610a086020830184614367565b60008060008060006080868803121561459457600080fd5b85359450602086013567ffffffffffffffff8111156145b257600080fd5b6145be888289016141bc565b9699909850959660408101359660609091013595509350505050565b600081518084526020808501945080840160005b8381101561460d578151601b0b875295820195908201906001016145ee565b509495945050505050565b600081518084526020808501945080840160005b8381101561460d57815163ffffffff168752958201959082019060010161462c565b60006101008083526146628184018c61433b565b905060208a601b0b8185015263ffffffff8a166040850152838203606085015261468c828a6145da565b915083820360808501526146a08289614618565b915083820360a08501526146b48288614367565b915083820360c08501526146c88287614618565b84810360e0860152855180825282870193509082019060005b818110156147065784516001600160e01b0316835293830193918301916001016146e1565b50909d9c50505050505050505050505050565b6000806040838503121561472c57600080fd5b50508035926020909101359150565b8035614746816141a7565b919050565b60008060008060008060008060008060006101008c8e03121561476d57600080fd5b8b359a5060208c0135995061478460408d0161473b565b985067ffffffffffffffff8060608e013511156147a057600080fd5b6147b08e60608f01358f016141bc565b909950975060808d01358110156147c657600080fd5b6147d68e60808f01358f016141bc565b909750955060a08d0135945060c08d0135935060e08d01358110156147fa57600080fd5b5061480b8d60e08e01358e016141bc565b81935080925050509295989b509295989b9093969950565b60a08152600061483660a083018861433b565b86601b0b602084015263ffffffff86166040840152828103606084015261485d81866145da565b90508281036080840152610e118185614618565b60008060008060006080868803121561488957600080fd5b853594506020860135935060408601356148a2816141a7565b9250606086013567ffffffffffffffff8111156148be57600080fd5b614306888289016141bc565b6020815281602082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561490357600080fd5b8260051b80856040850137919091016040019392505050565b60006020828403121561492e57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610a0b57610a0b61494b565b6000600182016149865761498661494b565b5060010190565b60008184825b858110156149c45781356149a6816141a7565b6001600160a01b031683526020928301929190910190600101614993565b509095945050505050565b60208082528181018390526000908460408401835b86811015614a125782356149f7816141a7565b6001600160a01b0316825291830191908301906001016149e4565b509695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038816815286602082015285604082015260a060608201526000614a7560a083018688614a1d565b8281036080840152614a88818587614a1d565b9a9950505050505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614ad557614ad5614a96565b604052919050565b600067ffffffffffffffff821115614af757614af7614a96565b50601f01601f191660200190565b6000614b18614b1384614add565b614aac565b9050828152838383011115614b2c57600080fd5b613b9b836020830184614317565b600060208284031215614b4c57600080fd5b815167ffffffffffffffff811115614b6357600080fd5b8201601f81018413614b7457600080fd5b61156c84825160208401614b05565b60008251614b95818460208701614317565b9190910192915050565b8183823760009101908152919050565b6001600160a01b038416815260406020820152600061126c604083018486614a1d565b6000808335601e19843603018112614be957600080fd5b83018035915067ffffffffffffffff821115614c0457600080fd5b602001915036819003821315613be057600080fd5b8481526001600160a01b038416602082015260606040820152600061440e606083018486614a1d565b600060208284031215614c5457600080fd5b8151613b9b816141a7565b60208152600061156c602083018486614a1d565b63ffffffff828116828216039080821115614c9057614c9061494b565b5092915050565b6001600160e01b03828116828216818102831692918115828504821417614cc057614cc061494b565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160e01b0380841680614cf957614cf9614cc9565b92169190910492915050565b80820180821115610a0b57610a0b61494b565b600181811c90821680614d2c57607f821691505b602082108103614d4c57634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152600061126c604083018486614a1d565b600082601f830112614d7d57600080fd5b8135614d8b614b1382614add565b818152846020838601011115614da057600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614dd257600080fd5b83359250602084013567ffffffffffffffff80821115614df157600080fd5b614dfd87838801614d6c565b93506040860135915080821115614e1357600080fd5b50614e2086828701614d6c565b9150509250925092565b815160009082906020808601845b83811015614e5d5781516001600160a01b031685529382019390820190600101614e38565b50929695505050505050565b8082028115828204841417610a0b57610a0b61494b565b600082614e8f57614e8f614cc9565b500490565b8781526001600160a01b038716602082015260c060408201526000614ebd60c083018789614a1d565b606083019590955250608081019290925260a090910152949350505050565b80601b0b8114613d4c57600080fd5b60008060408385031215614efe57600080fd5b8251614f0981614edc565b602084015190925063ffffffff81168114614f2357600080fd5b809150509250929050565b60008060408385031215614f4157600080fd5b8251614f4c816141a7565b6020939093015192949293505050565b600067ffffffffffffffff821115614f7657614f76614a96565b5060051b60200190565b600082601f830112614f9157600080fd5b81516020614fa1614b1383614f5c565b82815260059290921b84018101918181019086841115614fc057600080fd5b8286015b84811015614a125780518352918301918301614fc4565b60008060408385031215614fee57600080fd5b825167ffffffffffffffff8082111561500657600080fd5b818501915085601f83011261501a57600080fd5b8151602061502a614b1383614f5c565b82815260059290921b8401810191818101908984111561504957600080fd5b948201945b83861015615070578551615061816141a7565b8252948201949082019061504e565b9188015191965090935050508082111561508957600080fd5b5061509685828601614f80565b9150509250929050565b82815260406020820152600061156c604083018461433b565b600080604083850312156150cc57600080fd5b8235915060208084013567ffffffffffffffff8111156150eb57600080fd5b8401601f810186136150fc57600080fd5b803561510a614b1382614f5c565b81815260059190911b8201830190838101908883111561512957600080fd5b928401925b828410156151475783358252928401929084019061512e565b80955050505050509250929050565b60008060006060848603121561516b57600080fd5b83359250602084013561517d81614edc565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b86815285602082015260a0604082015260006151c460a083018688614a1d565b60608301949094525060800152949350505050565b601f82111561521f57600081815260208120601f850160051c810160208610156152005750805b601f850160051c820191505b81811015612d485782815560010161520c565b505050565b67ffffffffffffffff83111561523c5761523c614a96565b6152508361524a8354614d18565b836151d9565b6000601f841160018114615284576000851561526c5750838201355b600019600387901b1c1916600186901b1783556152de565b600083815260209020601f19861690835b828110156152b55786850135825560209485019460019092019101615295565b50868210156152d25760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6000602082840312156152f757600080fd5b81518015158114613b9b57600080fd5b60008060006060848603121561531c57600080fd5b83519250602084015161532e81614edc565b8092505060408401519050925092509256fea264697066735822122007cf114e08bb54c5e187a967d6f8e378073903eb053db5f7a376a13a05e950b164736f6c6343000811003360a06040523480156200001157600080fd5b5060405162002c7c38038062002c7c833981016040819052620000349162000173565b6200003f3362000106565b6001600160a01b038216620000905760405162461bcd60e51b81526020600482015260126024820152714f776e65722061646472657373207a65726f60701b60448201526064015b60405180910390fd5b6001600160a01b038116620000e85760405162461bcd60e51b815260206004820152601960248201527f4170693353657276657256312061646472657373207a65726f00000000000000604482015260640162000087565b620000f38262000106565b6001600160a01b031660805250620001ab565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200016e57600080fd5b919050565b600080604083850312156200018757600080fd5b620001928362000156565b9150620001a26020840162000156565b90509250929050565b608051612a99620001e36000396000818161025e01528181611327015281816114b7015281816115cb01526118b60152612a996000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c8063796b89b91161010f578063be3cc74d116100a2578063ddb2575211610071578063ddb2575214610420578063f2fde38b14610433578063f8b2cb4f14610446578063fba8f22f1461046157600080fd5b8063be3cc74d146103ca578063d23bab14146103dd578063d3cc6647146103f0578063d4a66d921461041857600080fd5b80638f634751116100de5780638f6347511461037c57806391af241114610384578063ac9650d814610397578063b07a0c2f146103b757600080fd5b8063796b89b91461033f5780637a821819146103455780637ca50e85146103585780638da5cb5b1461036b57600080fd5b806342cbb15c116101875780635d868194116101565780635d868194146103095780636e85b69a1461031c578063715018a61461032f578063773f2edc1461033757600080fd5b806342cbb15c146102af578063437b9116146102b55780634dcc19fe146102d65780635989eaeb146102dc57600080fd5b80632d6a744e116101c35780632d6a744e146102595780633408e4701461029857806336b7840d1461029e5780633aad52b9146102a757600080fd5b8063074244ce146101f5578063085df6ab146102115780631761c219146102315780632412a9cb14610246575b600080fd5b6101fe61010081565b6040519081526020015b60405180910390f35b61022461021f366004611f36565b610474565b6040516102089190611fa0565b61024461023f366004611ffc565b61050e565b005b610244610254366004612048565b610679565b6102807f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610208565b466101fe565b6101fe61040081565b6101fe601581565b436101fe565b6102c86102c3366004612061565b610700565b60405161020892919061212e565b486101fe565b6102f96102ea366004611f36565b6001600160a01b03163b151590565b6040519015158152602001610208565b6101fe610317366004612187565b610866565b61022461032a366004612048565b610cec565b610244610d05565b6101fe610d4d565b426101fe565b6102f9610353366004612048565b610d5e565b610224610366366004612048565b610d80565b6000546001600160a01b0316610280565b6101fe610e2f565b610244610392366004612048565b610e4b565b6103aa6103a5366004612061565b610ed3565b60405161020891906121c9565b6102446103c5366004612048565b611054565b6102446103d8366004612048565b6110dd565b6102446103eb366004611ffc565b611163565b6104036103fe366004612048565b6112b4565b60405161020899989796959493929190612272565b6101fe611ac8565b61022461042e366004612048565b611ad4565b610244610441366004611f36565b611afe565b6101fe610454366004611f36565b6001600160a01b03163190565b61024461046f366004612331565b611b46565b6001602052600090815260409020805461048d9061236d565b80601f01602080910402602001604051908101604052809291908181526020018280546104b99061236d565b80156105065780601f106104db57610100808354040283529160200191610506565b820191906000526020600020905b8154815290600101906020018083116104e957829003601f168201915b505050505081565b610516611cef565b828061055d5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064015b60405180910390fd5b82826104008111156105b15760405162461bcd60e51b815260206004820152601a60248201527f55706461746520706172616d657465727320746f6f206c6f6e670000000000006044820152606401610554565b600085856040516105c39291906123a7565b60405180910390209050806007600089815260200190815260200160002054146106705760008781526007602090815260408083208490558383526009909152902080548691906106139061236d565b90501461063557600081815260096020526040902061063386888361241b565b505b867f0aea1ab3b222f6786a08c16b8f93ba421dfe07d2511afa7250ec3e9163b0b4208787604051610667929190612505565b60405180910390a25b50505050505050565b610681611cef565b80806106c05760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b6044820152606401610554565b6106cb600583611d4b565b156106fc5760405182907ff9f5c4d39275e5bd5f3c5c8c55bc35400693aeb978d180b545f88580dc4e1e7790600090a25b5050565b606080828067ffffffffffffffff81111561071d5761071d6123b7565b604051908082528060200260200182016040528015610746578160200160208202803683370190505b5092508067ffffffffffffffff811115610762576107626123b7565b60405190808252806020026020018201604052801561079557816020015b60608152602001906001900390816107805790505b50915060005b8181101561085d57308686838181106107b6576107b6612521565b90506020028101906107c89190612537565b6040516107d69291906123a7565b600060405180830381855af49150503d8060008114610811576040519150601f19603f3d011682016040523d82523d6000602084013e610816565b606091505b5085838151811061082957610829612521565b6020026020010185848151811061084257610842612521565b6020908102919091010191909152901515905260010161079b565b50509250929050565b600081603f198101610925576000806108818587018761257e565b90925090506001600160a01b0382166108dc5760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610554565b60408051606084901b6bffffffffffffffffffffffff19166020808301919091526034808301859052835180840390910181526054909201909252805191012093505050610c6d565b6101008110610c255761093a601560206125c0565b6109459060206125d7565b610951601560206125c0565b61095c9060206125d7565b6109679060406125d7565b61097191906125d7565b8111156109c05760405162461bcd60e51b815260206004820152601a60248201527f4461746120666565642064657461696c7320746f6f206c6f6e670000000000006044820152606401610554565b6000806109cf858701876126aa565b915091508282826040516020016109e792919061279c565b6040516020818303038152906040525114610a445760405162461bcd60e51b815260206004820152601760248201527f4461746120666565642064657461696c7320747261696c0000000000000000006044820152606401610554565b815181518114610a965760405162461bcd60e51b815260206004820152601960248201527f506172616d65746572206c656e677468206d69736d61746368000000000000006044820152606401610554565b60008167ffffffffffffffff811115610ab157610ab16123b7565b604051908082528060200260200182016040528015610ada578160200160208202803683370190505b50905060005b82811015610c105760006001600160a01b0316858281518110610b0557610b05612521565b60200260200101516001600160a01b031603610b635760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610554565b610be1858281518110610b7857610b78612521565b6020026020010151858381518110610b9257610b92612521565b60200260200101516040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b828281518110610bf357610bf3612521565b602090810291909101015280610c08816127f2565b915050610ae0565b50610c1a81611d60565b955050505050610c6d565b60405162461bcd60e51b815260206004820152601b60248201527f4461746120666565642064657461696c7320746f6f2073686f727400000000006044820152606401610554565b60008281526002602052604090208054829190610c899061236d565b905014610ce5576000828152600260205260409020610ca984868361241b565b50817f4fe18adb29a4bae727e770ff666414a639679c10704d95f308a220b9a1b7477c8585604051610cdc929190612505565b60405180910390a25b5092915050565b6002602052600090815260409020805461048d9061236d565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e6365640000006044820152606401610554565b6000610d596003611d90565b905090565b60008181526002602052604081208054610d779061236d565b15159392505050565b600081815260076020908152604080832054835260099091529020805460609190610daa9061236d565b80601f0160208091040260200160405190810160405280929190818152602001828054610dd69061236d565b8015610e235780601f10610df857610100808354040283529160200191610e23565b820191906000526020600020905b815481529060010190602001808311610e0657829003601f168201915b50505050509050919050565b6000610e39611ac8565b610e41610d4d565b610d5991906125d7565b610e53611cef565b8080610e955760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b6044820152606401610554565b610ea0600383611d4b565b156106fc5760405182907e58637e39931c35fef05bbfd96b3881a0301ada925534f93fbfd5544df032cd90600090a25050565b6060818067ffffffffffffffff811115610eef57610eef6123b7565b604051908082528060200260200182016040528015610f2257816020015b6060815260200190600190039081610f0d5790505b50915060005b8181101561104c57600030868684818110610f4557610f45612521565b9050602002810190610f579190612537565b604051610f659291906123a7565b600060405180830381855af49150503d8060008114610fa0576040519150601f19603f3d011682016040523d82523d6000602084013e610fa5565b606091505b50858481518110610fb857610fb8612521565b6020908102919091010152905080611043576000848381518110610fde57610fde612521565b60200260200101519050600081511115610ffb5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610554565b50600101610f28565b505092915050565b61105c611cef565b808061109e5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b6044820152606401610554565b6110a9600383611d9a565b156106fc5760405182907f0b7c1d36481aee25427040847eb1bb0fe4419a9daf1a3daa7a2ed118a20128bf90600090a25050565b6110e5611cef565b80806111245760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b6044820152606401610554565b61112f600583611d9a565b156106fc5760405182907f240586c4e7a24b6151c6cbee3daebf773eae2e14f003cf24b204cc164c3066a790600090a25050565b61116b611cef565b82806111aa5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b6044820152606401610554565b82826104008111156111fe5760405162461bcd60e51b815260206004820152601a60248201527f55706461746520706172616d657465727320746f6f206c6f6e670000000000006044820152606401610554565b600085856040516112109291906123a7565b60405180910390209050806008600089815260200190815260200160002054146106705760008781526008602090815260408083208490558383526009909152902080548691906112609061236d565b90501461128257600081815260096020526040902061128086888361241b565b505b867f3ebb9b0f7d1ab582553a43d38e03a3533602282ff4fc10f5073d0b67d990dbfd8787604051610667929190612505565b600080606060008060608060608060006112cc610d4d565b9050808b10156112f3576112e160038c611da6565b99506112ec8a610d80565b92506113ea565b6112fd6005611d90565b61130790826125d7565b8b10156113ea5761132361131b828d61280b565b600590611da6565b98507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f18a60405160200161136791815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161139b91815260200190565b602060405180830381865afa1580156113b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc919061281e565b99506113e789611ad4565b92505b89156115325760008a815260026020526040902080546114099061236d565b80601f01602080910402602001604051908101604052809291908181526020018280546114359061236d565b80156114825780601f1061145757610100808354040283529160200191611482565b820191906000526020600020905b81548152906001019060200180831161146557829003601f168201915b50506040517f67a7cfb7000000000000000000000000000000000000000000000000000000008152600481018f9052939b50507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316926367a7cfb7925060240190506040805180830381865afa158015611508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152c9190612837565b90975095505b875115611aba5760408851036117b2576040805160018082528183019092529060208083019080368337505060408051600180825281830190925292975090506020808301908036833701905050604080516001808252818301909252919550816020015b6060815260200190600190039081611597579050509150600080898060200190518101906115c59190612880565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb761164484846040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6040518263ffffffff1660e01b815260040161166291815260200190565b6040805180830381865afa15801561167e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a29190612837565b886000815181106116b5576116b5612521565b60200260200101886000815181106116cf576116cf612521565b63ffffffff909316602093840291909101830152601b9290920b9091526001600160a01b0383166000908152600190915260409020805461170f9061236d565b80601f016020809104026020016040519081016040528092919081815260200182805461173b9061236d565b80156117885780601f1061175d57610100808354040283529160200191611788565b820191906000526020600020905b81548152906001019060200180831161176b57829003601f168201915b5050505050846000815181106117a0576117a0612521565b60200260200101819052505050611aba565b600080898060200190518101906117c99190612909565b815191935091508067ffffffffffffffff8111156117e9576117e96123b7565b604051908082528060200260200182016040528015611812578160200160208202803683370190505b5097508067ffffffffffffffff81111561182e5761182e6123b7565b604051908082528060200260200182016040528015611857578160200160208202803683370190505b5096508067ffffffffffffffff811115611873576118736123b7565b6040519080825280602002602001820160405280156118a657816020015b60608152602001906001900390816118915790505b50945060005b81811015611ab5577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb76119128684815181106118f8576118f8612521565b6020026020010151868581518110610b9257610b92612521565b6040518263ffffffff1660e01b815260040161193091815260200190565b6040805180830381865afa15801561194c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119709190612837565b8a838151811061198257611982612521565b602002602001018a848151811061199b5761199b612521565b602002602001018263ffffffff1663ffffffff1681525082601b0b601b0b8152505050600160008583815181106119d4576119d4612521565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208054611a079061236d565b80601f0160208091040260200160405190810160405280929190818152602001828054611a339061236d565b8015611a805780601f10611a5557610100808354040283529160200191611a80565b820191906000526020600020905b815481529060010190602001808311611a6357829003601f168201915b5050505050868281518110611a9757611a97612521565b60200260200101819052508080611aad906127f2565b9150506118ac565b505050505b509193959799909294969850565b6000610d596005611d90565b600081815260086020908152604080832054835260099091529020805460609190610daa9061236d565b60405162461bcd60e51b815260206004820152601f60248201527f4f776e6572736869702063616e6e6f74206265207472616e73666572726564006044820152606401610554565b611b4e611cef565b6001600160a01b038316611ba45760405162461bcd60e51b815260206004820152601460248201527f4169726e6f64652061646472657373207a65726f0000000000000000000000006044820152606401610554565b6101008282604051602001611bba9291906123a7565b604051602081830303815290604052511115611c185760405162461bcd60e51b815260206004820152601760248201527f5369676e6564204150492055524c20746f6f206c6f6e670000000000000000006044820152606401610554565b8181604051602001611c2b9291906123a7565b60408051601f1981840301815282825280516020918201206001600160a01b038716600090815260018352929092209192611c679291016129c4565b6040516020818303038152906040528051906020012014611cea576001600160a01b0383166000908152600160205260409020611ca582848361241b565b50826001600160a01b03167f1de1502db80e21e5a66f15b7adabc8c7c32f1fa1a0b7c51dbe01f4e50fe65c498383604051611ce1929190612505565b60405180910390a25b505050565b6000546001600160a01b03163314611d495760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610554565b565b6000611d578383611db2565b90505b92915050565b600081604051602001611d739190612a3a565b604051602081830303815290604052805190602001209050919050565b6000611d5a825490565b6000611d578383611ea5565b6000611d578383611ef4565b60008181526001830160205260408120548015611e9b576000611dd660018361280b565b8554909150600090611dea9060019061280b565b9050818114611e4f576000866000018281548110611e0a57611e0a612521565b9060005260206000200154905080876000018481548110611e2d57611e2d612521565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611e6057611e60612a4d565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611d5a565b6000915050611d5a565b6000818152600183016020526040812054611eec57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611d5a565b506000611d5a565b6000826000018281548110611f0b57611f0b612521565b9060005260206000200154905092915050565b6001600160a01b0381168114611f3357600080fd5b50565b600060208284031215611f4857600080fd5b8135611f5381611f1e565b9392505050565b6000815180845260005b81811015611f8057602081850181015186830182015201611f64565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611d576020830184611f5a565b60008083601f840112611fc557600080fd5b50813567ffffffffffffffff811115611fdd57600080fd5b602083019150836020828501011115611ff557600080fd5b9250929050565b60008060006040848603121561201157600080fd5b83359250602084013567ffffffffffffffff81111561202f57600080fd5b61203b86828701611fb3565b9497909650939450505050565b60006020828403121561205a57600080fd5b5035919050565b6000806020838503121561207457600080fd5b823567ffffffffffffffff8082111561208c57600080fd5b818501915085601f8301126120a057600080fd5b8135818111156120af57600080fd5b8660208260051b85010111156120c457600080fd5b60209290920196919550909350505050565b600082825180855260208086019550808260051b84010181860160005b8481101561212157601f1986840301895261210f838351611f5a565b988401989250908301906001016120f3565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b8281101561216957815115158452928401929084019060010161214b565b5050508381038285015261217d81866120d6565b9695505050505050565b6000806020838503121561219a57600080fd5b823567ffffffffffffffff8111156121b157600080fd5b6121bd85828601611fb3565b90969095509350505050565b602081526000611d5760208301846120d6565b600081518084526020808501945080840160005b8381101561221257815163ffffffff16875295820195908201906001016121f0565b509495945050505050565b600081518084526020808501808196508360051b8101915082860160005b85811015612265578284038952612253848351611f5a565b9885019893509084019060010161223b565b5091979650505050505050565b60006101208b835260208b818501528160408501526122938285018c611f5a565b601b8b810b606087015263ffffffff8b16608087015285820360a08701528951808352838b019450909183019060005b818110156122e1578551840b835294840194918401916001016122c3565b505085810360c08701526122f5818a6121dc565b935050505082810360e084015261230c8186611f5a565b9050828103610100840152612321818561221d565b9c9b505050505050505050505050565b60008060006040848603121561234657600080fd5b833561235181611f1e565b9250602084013567ffffffffffffffff81111561202f57600080fd5b600181811c9082168061238157607f821691505b6020821081036123a157634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b601f821115611cea57600081815260208120601f850160051c810160208610156123f45750805b601f850160051c820191505b8181101561241357828155600101612400565b505050505050565b67ffffffffffffffff831115612433576124336123b7565b61244783612441835461236d565b836123cd565b6000601f84116001811461247b57600085156124635750838201355b600019600387901b1c1916600186901b1783556124d5565b600083815260209020601f19861690835b828110156124ac578685013582556020948501946001909201910161248c565b50868210156124c95760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6020815260006125196020830184866124dc565b949350505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261254e57600080fd5b83018035915067ffffffffffffffff82111561256957600080fd5b602001915036819003821315611ff557600080fd5b6000806040838503121561259157600080fd5b823561259c81611f1e565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417611d5a57611d5a6125aa565b80820180821115611d5a57611d5a6125aa565b604051601f8201601f1916810167ffffffffffffffff81118282101715612613576126136123b7565b604052919050565b600067ffffffffffffffff821115612635576126356123b7565b5060051b60200190565b600082601f83011261265057600080fd5b813560206126656126608361261b565b6125ea565b82815260059290921b8401810191818101908684111561268457600080fd5b8286015b8481101561269f5780358352918301918301612688565b509695505050505050565b600080604083850312156126bd57600080fd5b823567ffffffffffffffff808211156126d557600080fd5b818501915085601f8301126126e957600080fd5b813560206126f96126608361261b565b82815260059290921b8401810191818101908984111561271857600080fd5b948201945b8386101561273f57853561273081611f1e565b8252948201949082019061271d565b9650508601359250508082111561275557600080fd5b506127628582860161263f565b9150509250929050565b600081518084526020808501945080840160005b8381101561221257815187529582019590820190600101612780565b604080825283519082018190526000906020906060840190828701845b828110156127de5781516001600160a01b0316845292840192908401906001016127b9565b5050508381038285015261217d818661276c565b600060018201612804576128046125aa565b5060010190565b81810381811115611d5a57611d5a6125aa565b60006020828403121561283057600080fd5b5051919050565b6000806040838503121561284a57600080fd5b825180601b0b811461285b57600080fd5b602084015190925063ffffffff8116811461287557600080fd5b809150509250929050565b6000806040838503121561289357600080fd5b825161289e81611f1e565b6020939093015192949293505050565b600082601f8301126128bf57600080fd5b815160206128cf6126608361261b565b82815260059290921b840181019181810190868411156128ee57600080fd5b8286015b8481101561269f57805183529183019183016128f2565b6000806040838503121561291c57600080fd5b825167ffffffffffffffff8082111561293457600080fd5b818501915085601f83011261294857600080fd5b815160206129586126608361261b565b82815260059290921b8401810191818101908984111561297757600080fd5b948201945b8386101561299e57855161298f81611f1e565b8252948201949082019061297c565b918801519196509093505050808211156129b757600080fd5b50612762858286016128ae565b60008083546129d28161236d565b600182811680156129ea57600181146129ff57612a2e565b60ff1984168752821515830287019450612a2e565b8760005260208060002060005b85811015612a255781548a820152908401908201612a0c565b50505082870194505b50929695505050505050565b602081526000611d57602083018461276c565b634e487b7160e01b600052603160045260246000fdfea26469706673582212202d2355529b21fa1cea229167772a21d13bd67bbc950d4d21698af126d4a8f18364736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106102d05760003560e01c8063796b89b911610179578063c1516e54116100d6578063d7fecd8c1161008a578063f2fde38b11610064578063f2fde38b146108f5578063f8b2cb4f14610915578063fa0130671461093d57600080fd5b8063d7fecd8c1461089a578063d8d2f90f146108ad578063e637cf00146108de57600080fd5b8063d5659f31116100bb578063d5659f311461081c578063d658d2e914610831578063d7fa10071461087a57600080fd5b8063c1516e54146107c8578063c6c04e16146107e857600080fd5b80639ae06c841161012d578063aa2b44e411610112578063aa2b44e41461073a578063ac9650d814610767578063c10f1a751461079457600080fd5b80639ae06c84146106fa578063a5f36cb11461071a57600080fd5b80638c9f4c791161015e5780638c9f4c79146106265780638da5cb5b1461065357806394259c6c1461067157600080fd5b8063796b89b9146105e6578063845ebe43146105f957600080fd5b80633adb35fe116102325780635849e5ef116101e65780635d868194116101c05780635d8681941461059157806364c2359d146105b1578063715018a6146105d157600080fd5b80635849e5ef146105225780635885c771146105425780635989eaeb1461055757600080fd5b8063437b911611610217578063437b9116146104ad5780634dcc19fe146104db57806353130e26146104ee57600080fd5b80633adb35fe1461044057806342cbb15c1461049a57600080fd5b80631d911b6d116102895780632d6a744e1161026e5780632d6a744e146103cc5780633408e4701461041857806336dff6531461042b57600080fd5b80631d911b6d14610397578063288ddb61146103b757600080fd5b8063044c9bd7116102ba578063044c9bd71461032a57806318d6e2d4146103575780631a0a0b3e1461037757600080fd5b8062aae33f146102d55780630141ff4814610308575b600080fd5b3480156102e157600080fd5b506102f56102f0366004614100565b61095d565b6040519081526020015b60405180910390f35b34801561031457600080fd5b50610328610323366004614142565b610a11565b005b34801561033657600080fd5b506102f5610345366004614142565b60009081526001602052604090205490565b34801561036357600080fd5b5061032861037236600461415b565b610ae9565b34801561038357600080fd5b506102f56103923660046141fe565b610d5a565b3480156103a357600080fd5b506103286103b2366004614294565b610e1d565b3480156103c357600080fd5b506102f561100f565b3480156103d857600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102ff565b34801561042457600080fd5b50466102f5565b34801561043757600080fd5b506102f5600581565b34801561044c57600080fd5b506102f56040517f417069334d61726b6574207369676e61747572652064656c65676174696f6e006020820152600090603f0160405160208183030381529060405280519060200120905090565b3480156104a657600080fd5b50436102f5565b3480156104b957600080fd5b506104cd6104c8366004614100565b611055565b6040516102ff9291906143bf565b3480156104e757600080fd5b50486102f5565b3480156104fa57600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b34801561052e57600080fd5b5061040061053d366004614418565b6111bb565b34801561054e57600080fd5b506102f5611275565b34801561056357600080fd5b50610581610572366004614474565b6001600160a01b03163b151590565b60405190151581526020016102ff565b34801561059d57600080fd5b506102f56105ac366004614491565b6112a6565b3480156105bd57600080fd5b506102f56105cc366004614142565b611310565b3480156105dd57600080fd5b506103286113c6565b3480156105f257600080fd5b50426102f5565b34801561060557600080fd5b506102f5610614366004614142565b60026020526000908152604090205481565b34801561063257600080fd5b50610646610641366004614142565b61140e565b6040516102ff91906144c7565b34801561065f57600080fd5b506000546001600160a01b0316610400565b34801561067d57600080fd5b506106c761068c366004614142565b600360205260009081526040902080546001820154600290920154909163ffffffff8116916401000000009091046001600160e01b03169084565b6040805194855263ffffffff90931660208501526001600160e01b039091169183019190915260608201526080016102ff565b34801561070657600080fd5b506104006107153660046144da565b6114bd565b34801561072657600080fd5b50610328610735366004614519565b611574565b34801561074657600080fd5b506102f5610755366004614142565b60046020526000908152604090205481565b34801561077357600080fd5b50610787610782366004614100565b611b0b565b6040516102ff9190614569565b3480156107a057600080fd5b506104007f000000000000000000000000000000000000000000000000000000000000000081565b3480156107d457600080fd5b506102f56107e336600461457c565b611c8c565b3480156107f457600080fd5b50610808610803366004614142565b611e38565b6040516102ff98979695949392919061464e565b34801561082857600080fd5b506102f56121bd565b34801561083d57600080fd5b5061086561084c366004614142565b6001602081905260009182526040909120805491015482565b604080519283526020830191909152016102ff565b34801561088657600080fd5b50610328610895366004614719565b6121ee565b6102f56108a836600461474b565b61225f565b3480156108b957600080fd5b506108cd6108c8366004614142565b61249a565b6040516102ff959493929190614823565b3480156108ea57600080fd5b506102f56201518081565b34801561090157600080fd5b50610328610910366004614474565b612987565b34801561092157600080fd5b506102f5610930366004614474565b6001600160a01b03163190565b34801561094957600080fd5b50610328610958366004614871565b6129cf565b6040517eaae33f0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169062aae33f906109c590869086906004016148ca565b6020604051808303816000875af11580156109e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a08919061491c565b90505b92915050565b60008181526004602052604090205480610a725760405162461bcd60e51b815260206004820152601860248201527f537562736372697074696f6e20717565756520656d707479000000000000000060448201526064015b60405180910390fd5b6000818152600360205260409020600101544263ffffffff9091161115610adb5760405162461bcd60e51b815260206004820152601e60248201527f43757272656e7420737562736372697074696f6e206e6f7420656e64656400006044820152606401610a69565b610ae58282612c36565b5050565b610af1612da6565b82610b3e5760405162461bcd60e51b815260206004820152600e60248201527f486173682074797065207a65726f0000000000000000000000000000000000006044820152606401610a69565b806000819003610b905760405162461bcd60e51b815260206004820152600d60248201527f5369676e65727320656d707479000000000000000000000000000000000000006044820152606401610a69565b600083838281610ba257610ba2614935565b9050602002016020810190610bb79190614474565b6001600160a01b031603610c0d5760405162461bcd60e51b815260206004820152601960248201527f4669727374207369676e65722061646472657373207a65726f000000000000006044820152606401610a69565b60015b81811015610ce1578383610c25600184614961565b818110610c3457610c34614935565b9050602002016020810190610c499190614474565b6001600160a01b0316848483818110610c6457610c64614935565b9050602002016020810190610c799190614474565b6001600160a01b031611610ccf5760405162461bcd60e51b815260206004820152601e60248201527f5369676e657273206e6f7420696e20617363656e64696e67206f7264657200006044820152606401610a69565b80610cd981614974565b915050610c10565b508282604051602001610cf592919061498d565b60408051601f198184030181528282528051602091820120600088815260029092529190205584907f5a1f5ee4ceedd78b1982374b4790e8aa9f31e8af1c32aaef46b2afd8a789193a90610d4c90869086906149cf565b60405180910390a250505050565b6040517f1a0a0b3e0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631a0a0b3e90610dce908b908b908b908b908b908b908b90600401614a46565b6020604051808303816000875af1158015610ded573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e11919061491c565b98975050505050505050565b610e2a8585858585612e11565b6040517f085df6ab0000000000000000000000000000000000000000000000000000000081526001600160a01b0386811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063085df6ab90602401600060405180830381865afa158015610ea9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed19190810190614b3a565b604051602001610ee19190614b83565b604051602081830303815290604052805190602001208484604051602001610f0a929190614b9f565b6040516020818303038152906040528051906020012003610f6d5760405162461bcd60e51b815260206004820152601e60248201527f446f6573206e6f7420757064617465207369676e6564204150492055524c00006044820152606401610a69565b6040517ffba8f22f0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063fba8f22f90610fd690889088908890600401614baf565b600060405180830381600087803b158015610ff057600080fd5b505af1158015611004573d6000803e3d6000fd5b505050505050505050565b6040517f644150492070726963696e67204d65726b6c6520726f6f74000000000000000060208201526038015b6040516020818303038152906040528051906020012081565b606080828067ffffffffffffffff81111561107257611072614a96565b60405190808252806020026020018201604052801561109b578160200160208202803683370190505b5092508067ffffffffffffffff8111156110b7576110b7614a96565b6040519080825280602002602001820160405280156110ea57816020015b60608152602001906001900390816110d55790505b50915060005b818110156111b2573086868381811061110b5761110b614935565b905060200281019061111d9190614bd2565b60405161112b929190614b9f565b600060405180830381855af49150503d8060008114611166576040519150601f19603f3d011682016040523d82523d6000602084013e61116b565b606091505b5085838151811061117e5761117e614935565b6020026020010185848151811061119757611197614935565b602090810291909101019190915290151590526001016110f0565b50509250929050565b6040517f5849e5ef0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635849e5ef90611229908890889088908890600401614c19565b6020604051808303816000875af1158015611248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126c9190614c42565b95945050505050565b6040517f64415049206d616e6167656d656e74204d65726b6c6520726f6f7400000000006020820152603b0161103c565b6040517f5d8681940000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635d868194906109c59086908690600401614c5f565b60008061131c42612f57565b600084815260046020526040812054919250905b80156113be576000818152600360205260409020600181015490925063ffffffff16428111156113b2576001830154620151809064010000000090046001600160e01b031661137f8684614c73565b63ffffffff1661138f9190614c97565b6113999190614cdf565b6113ac906001600160e01b031686614d05565b94508093505b50506002810154611330565b505050919050565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e6365640000006044820152606401610a69565b60008181526003602090815260408083205483526005909152902080546060919061143890614d18565b80601f016020809104026020016040519081016040528092919081815260200182805461146490614d18565b80156114b15780601f10611486576101008083540402835291602001916114b1565b820191906000526020600020905b81548152906001019060200180831161149457829003601f168201915b50505050509050919050565b6040517f9ae06c840000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690639ae06c849061152990879087908790600401614d52565b6020604051808303816000875af1158015611548573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156c9190614c42565b949350505050565b836115c15760405162461bcd60e51b815260206004820152600f60248201527f486173682076616c7565207a65726f00000000000000000000000000000000006044820152606401610a69565b428311156116115760405162461bcd60e51b815260206004820152601a60248201527f486173682074696d657374616d702066726f6d206675747572650000000000006044820152606401610a69565b6000858152600160208190526040909120015483116116725760405162461bcd60e51b815260206004820152601e60248201527f486173682074696d657374616d70206e6f74206d6f726520726563656e7400006044820152606401610a69565b600085815260026020526040902054806116ce5760405162461bcd60e51b815260206004820152600f60248201527f5369676e657273206e6f742073657400000000000000000000000000000000006044820152606401610a69565b8160008167ffffffffffffffff8111156116ea576116ea614a96565b604051908082528060200260200182016040528015611713578160200160208202803683370190505b5060408051602081018b905290810189905260608101889052909150600090611783906080015b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b905060005b83811015611a1d5760008787838181106117a4576117a4614935565b90506020028101906117b69190614bd2565b915050604019810161185b57611824838989858181106117d8576117d8614935565b90506020028101906117ea9190614bd2565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fd792505050565b84838151811061183657611836614935565b60200260200101906001600160a01b031690816001600160a01b031681525050611a0a565b61016081036119c25760008060008a8a8681811061187b5761187b614935565b905060200281019061188d9190614bd2565b81019061189a9190614dbd565b9250925092508242106118ef5760405162461bcd60e51b815260206004820152601060248201527f44656c65676174696f6e20656e646564000000000000000000000000000000006044820152606401610a69565b6119886119826119426040517f417069334d61726b6574207369676e61747572652064656c65676174696f6e006020820152600090603f0160405160208183030381529060405280519060200120905090565b61194c8985612fd7565b8660405160200161173a9392919092835260609190911b6bffffffffffffffffffffffff19166020830152603482015260540190565b83612fd7565b87868151811061199a5761199a614935565b60200260200101906001600160a01b031690816001600160a01b031681525050505050611a0a565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610a69565b5080611a1581614974565b915050611788565b5081604051602001611a2f9190614e2a565b604051602081830303815290604052805190602001208414611a935760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610a69565b60408051808201825289815260208082018a815260008d815260019283905284902092518355519101555189907fa33e8931ee2a869317bbe04201dab2907fd39d2d7f014c15b8459986e62c279190611af8908b908b90918252602082015260400190565b60405180910390a2505050505050505050565b6060818067ffffffffffffffff811115611b2757611b27614a96565b604051908082528060200260200182016040528015611b5a57816020015b6060815260200190600190039081611b455790505b50915060005b81811015611c8457600030868684818110611b7d57611b7d614935565b9050602002810190611b8f9190614bd2565b604051611b9d929190614b9f565b600060405180830381855af49150503d8060008114611bd8576040519150601f19603f3d011682016040523d82523d6000602084013e611bdd565b606091505b50858481518110611bf057611bf0614935565b6020908102919091010152905080611c7b576000848381518110611c1657611c16614935565b60200260200101519050600081511115611c335780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610a69565b50600101611b60565b505092915050565b600060608414611cde5760405162461bcd60e51b815260206004820181905260248201527f55706461746520706172616d6574657273206c656e67746820696e76616c69646044820152606401610a69565b600080600080611cf08a8a8a8a612ffb565b93509350935093506000878762015180611d0a9190614e69565b611d149190614e80565b90506000611d2142612f57565b905060008415611d3f5760008d815260046020526040902054611d41565b865b90505b8015611e2857868103611d91576201518083611d608489614c73565b63ffffffff16611d709190614e69565b611d7a9190614e80565b611d849089614d05565b9750859150839050611d44565b6000818152600360205260409020600181015463ffffffff1642811115611e0a576001820154620151809064010000000090046001600160e01b0316611dd78684614c73565b63ffffffff16611de79190614c97565b611df19190614cdf565b611e04906001600160e01b03168b614d05565b99508093505b828703611e1957889250611e21565b816002015492505b5050611d44565b5050505050505095945050505050565b6060600080606080606080606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f18b604051602001611e8991815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611ebd91815260200190565b602060405180830381865afa158015611eda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efe919061491c565b9050611f098161249a565b60008f815260046020526040812054959e50939c50919a5098509650905b8015611f545781611f3781614974565b60009283526003602052604090922060020154919250611f279050565b508067ffffffffffffffff811115611f6e57611f6e614a96565b604051908082528060200260200182016040528015611fa157816020015b6060815260200190600190039081611f8c5790505b5094508067ffffffffffffffff811115611fbd57611fbd614a96565b604051908082528060200260200182016040528015611fe6578160200160208202803683370190505b5093508067ffffffffffffffff81111561200257612002614a96565b60405190808252806020026020018201604052801561202b578160200160208202803683370190505b5060008c8152600460209081526040808320548352600390915281209194505b828110156121ae5781546000908152600560205260409020805461206e90614d18565b80601f016020809104026020016040519081016040528092919081815260200182805461209a90614d18565b80156120e75780601f106120bc576101008083540402835291602001916120e7565b820191906000526020600020905b8154815290600101906020018083116120ca57829003601f168201915b50505050508782815181106120fe576120fe614935565b60209081029190910101526001820154865163ffffffff9091169087908390811061212b5761212b614935565b602002602001019063ffffffff16908163ffffffff16815250508160010160049054906101000a90046001600160e01b031685828151811061216f5761216f614935565b6001600160e01b0390921660209283029190910182015260029092015460009081526003909252604090912090806121a681614974565b91505061204b565b50505050919395975091939597565b6040517f5369676e6564204150492055524c204d65726b6c6520726f6f740000000000006020820152603a0161103c565b6121f6612da6565b604080518082018252828152426020808301828152600087815260018084529086902094518555905193019290925582518481529182015283917f19cb5bc6996c2541fb44252778e9c8c952662cce4670a75a4174b50c765bd7d1910160405180910390a25050565b60008a6122ae5760405162461bcd60e51b815260206004820152601160248201527f446174612066656564204944207a65726f0000000000000000000000000000006044820152606401610a69565b6001600160a01b038a166123045760405162461bcd60e51b815260206004820152601b60248201527f53706f6e736f722077616c6c65742061646472657373207a65726f00000000006044820152606401610a69565b6123118c8c8c8c8c61324d565b6123208c888888888888613379565b61232e8c8c89898989613574565b90506123398c611310565b61234d346001600160a01b038d1631614d05565b101561239b5760405162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74207061796d656e740000000000000000000000006044820152606401610a69565b808c7fd44e8abecc305a9434d27a049c731a8331cee8bca6496154f47835b396ce55068d8d8b8b8b8b346040516123d89796959493929190614e94565b60405180910390a3341561248b5760008a6001600160a01b03163460405160006040518083038185875af1925050503d8060008114612433576040519150601f19603f3d011682016040523d82523d6000602084013e612438565b606091505b50509050806124895760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c00000000000000000000006044820152606401610a69565b505b9b9a5050505050505050505050565b60606000806060807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e85b69a876040518263ffffffff1660e01b81526004016124f091815260200190565b600060405180830381865afa15801561250d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526125359190810190614b3a565b6040516367a7cfb760e01b8152600481018890529095507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906367a7cfb7906024016040805180830381865afa15801561259c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c09190614eeb565b86519195509350603f190161275a5760408051600180825281830190925290602080830190803683375050604080516001808252818301909252929450905060208083019080368337019050509050600080868060200190518101906126269190614f2e565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb76126a584846040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6040518263ffffffff1660e01b81526004016126c391815260200190565b6040805180830381865afa1580156126df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127039190614eeb565b8560008151811061271657612716614935565b602002602001018560008151811061273057612730614935565b602002602001018263ffffffff1663ffffffff1681525082601b0b601b0b8152505050505061297e565b600080868060200190518101906127719190614fdb565b815191935091508067ffffffffffffffff81111561279157612791614a96565b6040519080825280602002602001820160405280156127ba578160200160208202803683370190505b5094508067ffffffffffffffff8111156127d6576127d6614a96565b6040519080825280602002602001820160405280156127ff578160200160208202803683370190505b50935060005b81811015612979577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166367a7cfb76128ba86848151811061285157612851614935565b602002602001015186858151811061286b5761286b614935565b60200260200101516040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b6040518263ffffffff1660e01b81526004016128d891815260200190565b6040805180830381865afa1580156128f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129189190614eeb565b87838151811061292a5761292a614935565b6020026020010187848151811061294357612943614935565b602002602001018263ffffffff1663ffffffff1681525082601b0b601b0b8152505050808061297190614974565b915050612805565b505050505b91939590929450565b60405162461bcd60e51b815260206004820152601f60248201527f4f776e6572736869702063616e6e6f74206265207472616e73666572726564006044820152606401610a69565b8315612a30576001600160a01b038316612a2b5760405162461bcd60e51b815260206004820152601b60248201527f53706f6e736f722077616c6c65742061646472657373207a65726f00000000006044820152606401610a69565b612a87565b6001600160a01b03831615612a875760405162461bcd60e51b815260206004820152601f60248201527f53706f6e736f722077616c6c65742061646472657373206e6f74207a65726f006044820152606401610a69565b612a94858585858561324d565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f187604051602001612ad891815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401612b0c91815260200190565b602060405180830381865afa158015612b29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4d919061491c565b9050848103612b9e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652064415049206e616d65000000000000006044820152606401610a69565b8415612bad57612bad856139ab565b6040516391eed08560e01b815260048101879052602481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391eed08590604401600060405180830381600087803b158015612c1657600080fd5b505af1158015612c2a573d6000803e3d6000fd5b50505050505050505050565b5b6000908152600360205260409020600201548015801590612c7157506000818152600360205260409020600101544263ffffffff90911611155b612c3757604051819083907fe08aff0930a0c84c077d2ce7e690a3f910c0f8705376b2405816efb89b9869b790600090a3600082815260046020526040902081905580612d50576040517f2412a9cb000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632412a9cb906024015b600060405180830381600087803b158015612d3457600080fd5b505af1158015612d48573d6000803e3d6000fd5b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d23bab1483612d898461140e565b6040518363ffffffff1660e01b8152600401612d1a9291906150a0565b33612db96000546001600160a01b031690565b6001600160a01b031614612e0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a69565b565b600080612e20838501856150b9565b915091508160016000604051602001612e5c907f5369676e6564204150492055524c204d65726b6c6520726f6f740000000000008152601a0190565b6040516020818303038152906040528051906020012081526020019081526020016000206000015414612ec05760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b612f128183898989604051602001612eda93929190614baf565b60408051601f198184030181528282528051602091820120908301520160405160208183030381529060405280519060200120613b8a565b612f4e5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610a69565b50505050505050565b600063ffffffff821115612fd35760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201527f32206269747300000000000000000000000000000000000000000000000000006064820152608401610a69565b5090565b6000806000612fe68585613ba2565b91509150612ff381613be7565b509392505050565b600080600080878787604051613012929190614b9f565b6040519081900381206130319291602001918252602082015260400190565b60405160208183030381529060405280519060200120935061305d85426130589190614d05565b612f57565b92506000808061306f898b018b615156565b60008e81526004602052604081205493965091945092509081905b80156131ec57600081815260036020526040812080549093506130b290889088908890613d4f565b60018085015491925063ffffffff909116908260028111156130d6576130d661518e565b14806130ed57508063ffffffff168b63ffffffff16115b6131395760405162461bcd60e51b815260206004820152601d60248201527f537562736372697074696f6e20646f6573206e6f7420757067726164650000006044820152606401610a69565b600282600281111561314d5761314d61518e565b14801561315f5750428163ffffffff16115b1561317657829950848061317290614974565b9550505b600182600281111561318a5761318a61518e565b1480156131a257508063ffffffff168b63ffffffff16105b156131df578298505b82156131d857846131bb81614974565b600094855260036020526040909420600201549395506131ab9050565b50506131ec565b505050600281015461308a565b506005821061323d5760405162461bcd60e51b815260206004820152601760248201527f537562736372697074696f6e2071756575652066756c6c0000000000000000006044820152606401610a69565b5050505050945094509450949050565b8461329a5760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610a69565b6000806132a9838501856150b9565b9150915081600160006040516020016132e5907f64415049206d616e6167656d656e74204d65726b6c6520726f6f7400000000008152601b0190565b60405160208183030381529060405280519060200120815260200190815260200160002060000154146133495760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b60408051602081018990529081018790526001600160a01b0386166060820152612f129082908490608001612eda565b606085146133c95760405162461bcd60e51b815260206004820181905260248201527f55706461746520706172616d6574657273206c656e67746820696e76616c69646044820152606401610a69565b836000036134195760405162461bcd60e51b815260206004820152600d60248201527f4475726174696f6e207a65726f000000000000000000000000000000000000006044820152606401610a69565b826000036134695760405162461bcd60e51b815260206004820152600a60248201527f5072696365207a65726f000000000000000000000000000000000000000000006044820152606401610a69565b600080613478838501856150b9565b9150915081600160006040516020016134b4907f644150492070726963696e67204d65726b6c6520726f6f740000000000000000815260180190565b60405160208183030381529060405280519060200120815260200190815260200160002060000154146135185760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a59081c9bdbdd60a21b6044820152606401610a69565b61353881838b468c8c8c8c604051602001612eda969594939291906151a4565b6110045760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610a69565b6000806000806135868a898989612ffb565b604051939750919550935091506000906135a3908a908a90614b9f565b604051809103902090506005600082815260200190815260200160002080546135cb90614d18565b90506000036135ef5760008181526005602052604090206135ed898b83615224565b505b6040805160808101825282815263ffffffff8616602082015290810161362b8961361c8a62015180614e69565b6136269190614e80565b613f04565b6001600160e01b03908116825260209182018590526000888152600383526040908190208451815592840151908401519091166401000000000263ffffffff9091161760018201556060909101516002909101558261380b5760008b81526004602052604090205485146136d85760405185908c907fe08aff0930a0c84c077d2ce7e690a3f910c0f8705376b2405816efb89b9869b790600090a360008b81526004602052604090208590555b6040517fd23bab140000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d23bab1490613741908e908d908d90600401614d52565b600060405180830381600087803b15801561375b57600080fd5b505af115801561376f573d6000803e3d6000fd5b50506040517fbe3cc74d000000000000000000000000000000000000000000000000000000008152600481018e90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316925063be3cc74d9150602401600060405180830381600087803b1580156137ee57600080fd5b505af1158015613802573d6000803e3d6000fd5b50505050613855565b60008381526003602081815260408084206002018990558e8452600482528084205480855292909152909120600101544263ffffffff90911611613853576138538c82612c36565b505b61385e8a6139ab565b897f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663472c22f18d6040516020016138a191815260200190565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016138d591815260200190565b602060405180830381865afa1580156138f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613916919061491c565b1461399d576040516391eed08560e01b8152600481018c9052602481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391eed08590604401600060405180830381600087803b15801561398457600080fd5b505af1158015613998573d6000803e3d6000fd5b505050505b505050509695505050505050565b6040516367a7cfb760e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906367a7cfb7906024016040805180830381865afa158015613a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a369190614eeb565b9150613a4d90506201518063ffffffff8316614d05565b421115613a9c5760405162461bcd60e51b815260206004820152601560248201527f4461746120666565642076616c7565207374616c6500000000000000000000006044820152606401610a69565b6040517f7a821819000000000000000000000000000000000000000000000000000000008152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a82181990602401602060405180830381865afa158015613b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b3e91906152e5565b610ae55760405162461bcd60e51b815260206004820152601860248201527f446174612066656564206e6f74207265676973746572656400000000000000006044820152606401610a69565b600082613b978584613f83565b1490505b9392505050565b6000808251604103613bd85760208301516040840151606085015160001a613bcc87828585613fc8565b94509450505050613be0565b506000905060025b9250929050565b6000816004811115613bfb57613bfb61518e565b03613c035750565b6001816004811115613c1757613c1761518e565b03613c645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a69565b6002816004811115613c7857613c7861518e565b03613cc55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a69565b6003816004811115613cd957613cd961518e565b03613d4c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610a69565b50565b6000818152600560205260408120805482918291829190613d6f90614d18565b80601f0160208091040260200160405190810160405280929190818152602001828054613d9b90614d18565b8015613de85780601f10613dbd57610100808354040283529160200191613de8565b820191906000526020600020905b815481529060010190602001808311613dcb57829003601f168201915b5050505050806020019051810190613e009190615307565b92509250925081601b0b87601b0b14613e5b5760405162461bcd60e51b815260206004820152601e60248201527f446576696174696f6e207265666572656e636573206e6f7420657175616c00006044820152606401610a69565b8288148015613e6957508086145b15613e7a576000935050505061156c565b828811158015613e8a5750808611155b15613e9b576001935050505061156c565b828810158015613eab5750808610155b15613ebc576002935050505061156c565b60405162461bcd60e51b815260206004820152601e60248201527f55706461746520706172616d657465727320696e636f6d70617261626c6500006044820152606401610a69565b60006001600160e01b03821115612fd35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203260448201527f32342062697473000000000000000000000000000000000000000000000000006064820152608401610a69565b600081815b8451811015612ff357613fb482868381518110613fa757613fa7614935565b602002602001015161408c565b915080613fc081614974565b915050613f88565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613fff5750600090506003614083565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614053573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661407c57600060019250925050614083565b9150600090505b94509492505050565b60008183106140a8576000828152602084905260409020610a08565b6000838152602083905260409020610a08565b60008083601f8401126140cd57600080fd5b50813567ffffffffffffffff8111156140e557600080fd5b6020830191508360208260051b8501011115613be057600080fd5b6000806020838503121561411357600080fd5b823567ffffffffffffffff81111561412a57600080fd5b614136858286016140bb565b90969095509350505050565b60006020828403121561415457600080fd5b5035919050565b60008060006040848603121561417057600080fd5b83359250602084013567ffffffffffffffff81111561418e57600080fd5b61419a868287016140bb565b9497909650939450505050565b6001600160a01b0381168114613d4c57600080fd5b60008083601f8401126141ce57600080fd5b50813567ffffffffffffffff8111156141e657600080fd5b602083019150836020828501011115613be057600080fd5b600080600080600080600060a0888a03121561421957600080fd5b8735614224816141a7565b96506020880135955060408801359450606088013567ffffffffffffffff8082111561424f57600080fd5b61425b8b838c016141bc565b909650945060808a013591508082111561427457600080fd5b506142818a828b016141bc565b989b979a50959850939692959293505050565b6000806000806000606086880312156142ac57600080fd5b85356142b7816141a7565b9450602086013567ffffffffffffffff808211156142d457600080fd5b6142e089838a016141bc565b909650945060408801359150808211156142f957600080fd5b50614306888289016141bc565b969995985093965092949392505050565b60005b8381101561433257818101518382015260200161431a565b50506000910152565b60008151808452614353816020860160208601614317565b601f01601f19169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b848110156143b257601f198684030189526143a083835161433b565b98840198925090830190600101614384565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b828110156143fa5781511515845292840192908401906001016143dc565b5050508381038285015261440e8186614367565b9695505050505050565b6000806000806060858703121561442e57600080fd5b843593506020850135614440816141a7565b9250604085013567ffffffffffffffff81111561445c57600080fd5b614468878288016141bc565b95989497509550505050565b60006020828403121561448657600080fd5b8135613b9b816141a7565b600080602083850312156144a457600080fd5b823567ffffffffffffffff8111156144bb57600080fd5b614136858286016141bc565b602081526000610a08602083018461433b565b6000806000604084860312156144ef57600080fd5b83359250602084013567ffffffffffffffff81111561450d57600080fd5b61419a868287016141bc565b60008060008060006080868803121561453157600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff81111561455d57600080fd5b614306888289016140bb565b602081526000610a086020830184614367565b60008060008060006080868803121561459457600080fd5b85359450602086013567ffffffffffffffff8111156145b257600080fd5b6145be888289016141bc565b9699909850959660408101359660609091013595509350505050565b600081518084526020808501945080840160005b8381101561460d578151601b0b875295820195908201906001016145ee565b509495945050505050565b600081518084526020808501945080840160005b8381101561460d57815163ffffffff168752958201959082019060010161462c565b60006101008083526146628184018c61433b565b905060208a601b0b8185015263ffffffff8a166040850152838203606085015261468c828a6145da565b915083820360808501526146a08289614618565b915083820360a08501526146b48288614367565b915083820360c08501526146c88287614618565b84810360e0860152855180825282870193509082019060005b818110156147065784516001600160e01b0316835293830193918301916001016146e1565b50909d9c50505050505050505050505050565b6000806040838503121561472c57600080fd5b50508035926020909101359150565b8035614746816141a7565b919050565b60008060008060008060008060008060006101008c8e03121561476d57600080fd5b8b359a5060208c0135995061478460408d0161473b565b985067ffffffffffffffff8060608e013511156147a057600080fd5b6147b08e60608f01358f016141bc565b909950975060808d01358110156147c657600080fd5b6147d68e60808f01358f016141bc565b909750955060a08d0135945060c08d0135935060e08d01358110156147fa57600080fd5b5061480b8d60e08e01358e016141bc565b81935080925050509295989b509295989b9093969950565b60a08152600061483660a083018861433b565b86601b0b602084015263ffffffff86166040840152828103606084015261485d81866145da565b90508281036080840152610e118185614618565b60008060008060006080868803121561488957600080fd5b853594506020860135935060408601356148a2816141a7565b9250606086013567ffffffffffffffff8111156148be57600080fd5b614306888289016141bc565b6020815281602082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561490357600080fd5b8260051b80856040850137919091016040019392505050565b60006020828403121561492e57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610a0b57610a0b61494b565b6000600182016149865761498661494b565b5060010190565b60008184825b858110156149c45781356149a6816141a7565b6001600160a01b031683526020928301929190910190600101614993565b509095945050505050565b60208082528181018390526000908460408401835b86811015614a125782356149f7816141a7565b6001600160a01b0316825291830191908301906001016149e4565b509695505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038816815286602082015285604082015260a060608201526000614a7560a083018688614a1d565b8281036080840152614a88818587614a1d565b9a9950505050505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715614ad557614ad5614a96565b604052919050565b600067ffffffffffffffff821115614af757614af7614a96565b50601f01601f191660200190565b6000614b18614b1384614add565b614aac565b9050828152838383011115614b2c57600080fd5b613b9b836020830184614317565b600060208284031215614b4c57600080fd5b815167ffffffffffffffff811115614b6357600080fd5b8201601f81018413614b7457600080fd5b61156c84825160208401614b05565b60008251614b95818460208701614317565b9190910192915050565b8183823760009101908152919050565b6001600160a01b038416815260406020820152600061126c604083018486614a1d565b6000808335601e19843603018112614be957600080fd5b83018035915067ffffffffffffffff821115614c0457600080fd5b602001915036819003821315613be057600080fd5b8481526001600160a01b038416602082015260606040820152600061440e606083018486614a1d565b600060208284031215614c5457600080fd5b8151613b9b816141a7565b60208152600061156c602083018486614a1d565b63ffffffff828116828216039080821115614c9057614c9061494b565b5092915050565b6001600160e01b03828116828216818102831692918115828504821417614cc057614cc061494b565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160e01b0380841680614cf957614cf9614cc9565b92169190910492915050565b80820180821115610a0b57610a0b61494b565b600181811c90821680614d2c57607f821691505b602082108103614d4c57634e487b7160e01b600052602260045260246000fd5b50919050565b83815260406020820152600061126c604083018486614a1d565b600082601f830112614d7d57600080fd5b8135614d8b614b1382614add565b818152846020838601011115614da057600080fd5b816020850160208301376000918101602001919091529392505050565b600080600060608486031215614dd257600080fd5b83359250602084013567ffffffffffffffff80821115614df157600080fd5b614dfd87838801614d6c565b93506040860135915080821115614e1357600080fd5b50614e2086828701614d6c565b9150509250925092565b815160009082906020808601845b83811015614e5d5781516001600160a01b031685529382019390820190600101614e38565b50929695505050505050565b8082028115828204841417610a0b57610a0b61494b565b600082614e8f57614e8f614cc9565b500490565b8781526001600160a01b038716602082015260c060408201526000614ebd60c083018789614a1d565b606083019590955250608081019290925260a090910152949350505050565b80601b0b8114613d4c57600080fd5b60008060408385031215614efe57600080fd5b8251614f0981614edc565b602084015190925063ffffffff81168114614f2357600080fd5b809150509250929050565b60008060408385031215614f4157600080fd5b8251614f4c816141a7565b6020939093015192949293505050565b600067ffffffffffffffff821115614f7657614f76614a96565b5060051b60200190565b600082601f830112614f9157600080fd5b81516020614fa1614b1383614f5c565b82815260059290921b84018101918181019086841115614fc057600080fd5b8286015b84811015614a125780518352918301918301614fc4565b60008060408385031215614fee57600080fd5b825167ffffffffffffffff8082111561500657600080fd5b818501915085601f83011261501a57600080fd5b8151602061502a614b1383614f5c565b82815260059290921b8401810191818101908984111561504957600080fd5b948201945b83861015615070578551615061816141a7565b8252948201949082019061504e565b9188015191965090935050508082111561508957600080fd5b5061509685828601614f80565b9150509250929050565b82815260406020820152600061156c604083018461433b565b600080604083850312156150cc57600080fd5b8235915060208084013567ffffffffffffffff8111156150eb57600080fd5b8401601f810186136150fc57600080fd5b803561510a614b1382614f5c565b81815260059190911b8201830190838101908883111561512957600080fd5b928401925b828410156151475783358252928401929084019061512e565b80955050505050509250929050565b60008060006060848603121561516b57600080fd5b83359250602084013561517d81614edc565b929592945050506040919091013590565b634e487b7160e01b600052602160045260246000fd5b86815285602082015260a0604082015260006151c460a083018688614a1d565b60608301949094525060800152949350505050565b601f82111561521f57600081815260208120601f850160051c810160208610156152005750805b601f850160051c820191505b81811015612d485782815560010161520c565b505050565b67ffffffffffffffff83111561523c5761523c614a96565b6152508361524a8354614d18565b836151d9565b6000601f841160018114615284576000851561526c5750838201355b600019600387901b1c1916600186901b1783556152de565b600083815260209020601f19861690835b828110156152b55786850135825560209485019460019092019101615295565b50868210156152d25760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6000602082840312156152f757600080fd5b81518015158114613b9b57600080fd5b60008060006060848603121561531c57600080fd5b83519250602084015161532e81614edc565b8092505060408401519050925092509256fea264697066735822122007cf114e08bb54c5e187a967d6f8e378073903eb053db5f7a376a13a05e950b164736f6c63430008110033", + "devdoc": { + "details": "The user is strongly recommended to use the API3 Market frontend while interacting with this contract, mostly because doing so successfully requires some amount of knowledge of other API3 contracts. Specifically, Api3Market requires the data feed for which the subscription is being purchased to be \"readied\", the correct Merkle proofs to be provided, and enough payment to be made. The API3 Market frontend will fetch the appropriate Merkle proofs, create a multicall transaction that will ready the data feed before making the call to buy the subscription, and compute the amount to be sent that will barely allow the subscription to be purchased. For most users, building such a transaction themselves would be too impractical.", + "kind": "dev", + "methods": { + "buySubscription(bytes32,bytes32,address,bytes,bytes,uint256,uint256,bytes)": { + "details": "The data feed that the dAPI name will be set to after this function is called must be readied (see `validateDataFeedReadiness()`) before calling this function. Enough funds must be sent to put the sponsor wallet balance over its expected amount after the subscription is bought. Since sponsor wallets send data feed update transactions, it is not possible to estimate what their balance will be at the time sent transactions are confirmed. To avoid transactions being reverted as a result of this, consider sending some extra.", + "params": { + "dapiManagementMerkleData": "ABI-encoded dAPI management Merkle root and proof", + "dapiName": "dAPI name", + "dapiPricingMerkleData": "ABI-encoded dAPI pricing Merkle root and proof", + "dataFeedId": "Data feed ID", + "duration": "Subscription duration", + "price": "Subscription price", + "sponsorWallet": "Sponsor wallet address", + "updateParameters": "Update parameters" + }, + "returns": { + "subscriptionId": "Subscription ID" + } + }, + "computeExpectedSponsorWalletBalance(bytes32)": { + "details": "API3 estimates the transaction fee cost of subscriptions, and prices them accordingly. The subscription fees paid for a dAPI are sent to the respective sponsor wallet, which will send the update transactions. In the case that a subscription is overpriced, the extra funds are automatically rolled over as a discount to the next subscription bought for the same dAPI. In the case that a subscription is underpriced, there is a risk of the sponsor wallet running out of funds, resulting in the subscription specs to not be met. To avoid this, API3 should poll this function for all active dAPI names, check the respective sponsor wallet balances, and top up the sponsor wallets as necessary. The conditions that result in the underpricing will most likely require an updated dAPI pricing Merkle root to be published.", + "params": { + "dapiName": "dAPI name" + }, + "returns": { + "expectedSponsorWalletBalance": "Expected sponsor wallet balance" + } + }, + "computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(bytes32,bytes,uint256,uint256)": { + "details": "This function is intended to be used by the API3 Market frontend to calculate how much the user should pay to purchase a specific subscription. As mentioned in the `buySubscription()` docstring, the user should aim for the sponsor wallet balance to be slightly more than the required amount in case it sends a transaction in the meantime, whose gas cost may decrease the sponsor wallet balance unexpectedly. Unit prices of the queued subscriptions are recorded on a daily basis and the expected balance is computed from these, which introduces a rounding error in the order of Weis. This also applies in practice (in that one can buy a subscription whose price is 1 ETH at 0.999... ETH). This behavior is accepted due to being trivial in effect.", + "params": { + "dapiName": "dAPI name", + "duration": "Subscription duration", + "price": "Subscription price", + "updateParameters": "Update parameters" + }, + "returns": { + "expectedSponsorWalletBalance": "Expected sponsor wallet balance" + } + }, + "constructor": { + "details": "Api3Market deploys its own AirseekerRegistry deterministically. This implies that Api3Market-specific Airseekers should be operated by pointing at this contract.", + "params": { + "owner_": "Owner address", + "proxyFactory_": "ProxyFactory contract address" + } + }, + "containsBytecode(address)": { + "details": "An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.", + "returns": { + "_0": "If the account contains bytecode" + } + }, + "deployDapiProxy(bytes32,bytes)": { + "details": "It is recommended for the users to read data feeds through proxies deployed by ProxyFactory, rather than calling Api3ServerV1 directly. Even though proxy deployment is not a condition for purchasing subscriptions, the interface is implemented here to allow the user to purchase a dAPI subscription and deploy the respective proxy in the same transaction with a multicall.", + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "getBalance(address)": { + "params": { + "account": "Account address" + }, + "returns": { + "_0": "Account balance" + } + }, + "getBlockBasefee()": { + "returns": { + "_0": "Current block basefee" + } + }, + "getBlockNumber()": { + "returns": { + "_0": "Current block number" + } + }, + "getBlockTimestamp()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "getChainId()": { + "returns": { + "_0": "Chain ID" + } + }, + "getDapiData(bytes32)": { + "details": "This function is intended to be used by the API3 Market frontend to get all data related to a specific dAPI. It returns the entire subscription queue, including the items whose end timestamps are in the past.", + "params": { + "dapiName": "dAPI name" + }, + "returns": { + "beaconTimestamps": "Beacon timestamps read from Api3ServerV1", + "beaconValues": "Beacon values read from Api3ServerV1", + "dailyPrices": "Daily prices of the subscriptions in the queue", + "dapiTimestamp": "dAPI timestamp read from Api3ServerV1", + "dapiValue": "dAPI value read from Api3ServerV1", + "dataFeedDetails": "Data feed details", + "endTimestamps": "End timestamps of the subscriptions in the queue", + "updateParameters": "Update parameters of the subscriptions in the queue" + } + }, + "getDataFeedData(bytes32)": { + "details": "This function is intended to be used by the API3 Market frontend to determine what needs to be done to ready the data feed to purchase the respective subscription.", + "params": { + "dataFeedId": "Data feed ID" + }, + "returns": { + "beaconTimestamps": "Beacon timestamps read from Api3ServerV1", + "beaconValues": "Beacon values read from Api3ServerV1", + "dataFeedDetails": "Data feed details", + "dataFeedTimestamp": "Data feed timestamp read from Api3ServerV1", + "dataFeedValue": "Data feed value read from Api3ServerV1" + } + }, + "getHashValue(bytes32)": { + "params": { + "hashType": "Hash type" + }, + "returns": { + "hashValue": "Hash value" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "owner()": { + "returns": { + "_0": "Owner address" + } + }, + "registerDataFeed(bytes)": { + "params": { + "dataFeedDetails": "Data feed details" + }, + "returns": { + "dataFeedId": "Data feed ID" + } + }, + "registerHash(bytes32,bytes32,uint256,bytes[])": { + "params": { + "hashTimestamp": "Hash timestamp", + "hashType": "Hash type", + "hashValue": "Hash value", + "signatures": "Signatures" + } + }, + "setHash(bytes32,bytes32)": { + "params": { + "hashType": "Hash type", + "hashValue": "Hash value" + } + }, + "setSigners(bytes32,address[])": { + "params": { + "hashType": "Hash type", + "signers": "Signer addresses" + } + }, + "signatureDelegationHashType()": { + "returns": { + "_0": "Signature delegation hash type" + } + }, + "subscriptionIdToUpdateParameters(bytes32)": { + "params": { + "subscriptionId": "Subscription ID" + }, + "returns": { + "updateParameters": "Update parameters" + } + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "params": { + "beaconIds": "Beacon IDs" + }, + "returns": { + "beaconSetId": "Updated Beacon set ID" + } + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "details": "The user is intended to make a multicall transaction through the API3 Market frontend to satisfy the required conditions to be able to buy a subscription and buy the subscription in a single transaction. The functions to which external calls must be made to to satisfy said conditions (such as this one) are added to this contract so that they can be multi-called by the user.", + "params": { + "airnode": "Airnode address", + "data": "Update data (an `int256` encoded in contract ABI)", + "signature": "Template ID, timestamp and the update data signed by the Airnode", + "templateId": "Template ID", + "timestamp": "Signature timestamp" + }, + "returns": { + "beaconId": "Updated Beacon ID" + } + }, + "updateCurrentSubscriptionId(bytes32)": { + "details": "The fact that there is a current subscription that has ended would mean that API3 is providing a service that was not paid for. Therefore, API3 should poll this function for all active dAPI names and call it whenever it is not going to revert to downgrade the specs.", + "params": { + "dapiName": "dAPI name" + } + }, + "updateDapiName(bytes32,bytes32,address,bytes)": { + "details": "Buying a dAPI subscription always updates the dAPI name if necessary. However, API3 may also publish new Merkle roots between subscription purchases, in which case API3 should call this function to bring the chain state up to date. Therefore, API3 should poll this function for all active dAPI names and call it whenever it will not revert. Similar to `buySubscription()`, this function requires the data feed that the dAPI will be pointed to to be readied. This function is allowed to be called even when the respective dAPI is not active, which means that a dAPI name being set does not imply that the respective data feed is in service. Users should only use dAPIs for which there is an active subscription with the update parameters that satisfy their needs.", + "params": { + "dapiManagementMerkleData": "ABI-encoded dAPI management Merkle root and proof", + "dapiName": "dAPI name", + "dataFeedId": "Data feed ID", + "sponsorWallet": "Sponsor wallet address" + } + }, + "updateSignedApiUrl(address,string,bytes)": { + "details": "Unlike the dAPI management and pricing Merkle leaves, the signed API URL Merkle leaves are not registered by the users as a part of subscription purchase transactions. API3 should poll this function for all Airnodes that are used in active dAPIs and call it whenever it will not revert.", + "params": { + "airnode": "Airnode address", + "signedApiUrl": "Signed API URL", + "signedApiUrlMerkleData": "ABI-encoded signed API URL Merkle root and proof" + } + } + }, + "stateVariables": { + "DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE": { + "details": "\"Hash type\" is what HashRegistry uses to address hashes used for different purposes" + }, + "MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH": { + "details": "Some functionality in this contract requires to iterate through the entire subscription queue for a dAPI, and the queue length is limited to prevent this process from being bloated. Considering that each item in the subscription queue has unique update parameters, the length of the subscription queue is also limited by the number of unique update parameters offered in the dAPI pricing Merkle tree. For reference, at the time this contract is implemented, the API3 Market offers 4 update parameter options, and this number is not expected to be increased (i.e., we do not expect this queue length limit to be hit in practice)." + } + }, + "title": "The contract that API3 users interact with using the API3 Market frontend to purchase data feed subscriptions", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE()": { + "notice": "dAPI management Merkle root hash type" + }, + "DAPI_PRICING_MERKLE_ROOT_HASH_TYPE()": { + "notice": "dAPI pricing Merkle root hash type" + }, + "MAXIMUM_DAPI_UPDATE_AGE()": { + "notice": "Maximum dAPI update age. This contract cannot be used to set a dAPI name to a data feed that has not been updated in the last `MAXIMUM_DAPI_UPDATE_AGE`." + }, + "MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH()": { + "notice": "Maximum subscription queue length for a dAPI" + }, + "SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE()": { + "notice": "Signed API URL Merkle root hash type" + }, + "airseekerRegistry()": { + "notice": "AirseekerRegistry contract address" + }, + "api3ServerV1()": { + "notice": "Api3ServerV1 contract address" + }, + "buySubscription(bytes32,bytes32,address,bytes,bytes,uint256,uint256,bytes)": { + "notice": "Buys subscription and updates the current subscription ID if necessary. The user is recommended to interact with this contract only over the API3 Market frontend due to its complexity." + }, + "computeExpectedSponsorWalletBalance(bytes32)": { + "notice": "Computes the expected sponsor wallet balance based on the current subscription queue" + }, + "computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(bytes32,bytes,uint256,uint256)": { + "notice": "Computes the expected sponsor wallet balance after the respective subscription is added to the queue" + }, + "containsBytecode(address)": { + "notice": "Returns if the account contains bytecode" + }, + "dapiNameToCurrentSubscriptionId(bytes32)": { + "notice": "dAPI name to current subscription ID, which denotes the start of the subscription queue for the dAPI" + }, + "deployDapiProxy(bytes32,bytes)": { + "notice": "Calls ProxyFactory to deterministically deploy the dAPI proxy" + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "notice": "Calls ProxyFactory to deterministically deploy the dAPI proxy with OEV support" + }, + "getBalance(address)": { + "notice": "Returns the account balance" + }, + "getBlockBasefee()": { + "notice": "Returns the current block basefee" + }, + "getBlockNumber()": { + "notice": "Returns the current block number" + }, + "getBlockTimestamp()": { + "notice": "Returns the current block timestamp" + }, + "getChainId()": { + "notice": "Returns the chain ID" + }, + "getDapiData(bytes32)": { + "notice": "Gets all data about the dAPI that is available" + }, + "getDataFeedData(bytes32)": { + "notice": "Gets all data about the data feed that is available" + }, + "getHashValue(bytes32)": { + "notice": "Returns get the hash value for the type" + }, + "hashTypeToSignersHash(bytes32)": { + "notice": "Hash type to the hash of the array of signer addresses" + }, + "hashes(bytes32)": { + "notice": "Hash type to the last registered value and timestamp" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "owner()": { + "notice": "Returns the owner address" + }, + "proxyFactory()": { + "notice": "ProxyFactory contract address" + }, + "registerDataFeed(bytes)": { + "notice": "Calls AirseekerRegistry to register the data feed" + }, + "registerHash(bytes32,bytes32,uint256,bytes[])": { + "notice": "Registers the hash value and timestamp for the respective type. The hash value cannot be zero. The timestamp must not exceed the block timestamp, yet be larger than the timestamp of the previous registration. The signers must have been set for the hash type, and the signatures must be sorted for the respective signer addresses to be in ascending order. Each signature can either be a standalone signature by the respective signer, or a signature by the signer's delegate, encoded along with the delegation end timestamp and delegation signature." + }, + "renounceOwnership()": { + "notice": "Overriden to be disabled" + }, + "setHash(bytes32,bytes32)": { + "notice": "Called by the owner to set a hash. Overrides previous registrations and is allowed to set the value to `bytes32(0)`." + }, + "setSigners(bytes32,address[])": { + "notice": "Called by the contract owner to set signers for a hash type. The signer addresses must be in ascending order." + }, + "signatureDelegationHashType()": { + "notice": "Returns the signature delegation hash type used in delegation signatures" + }, + "subscriptionIdToUpdateParameters(bytes32)": { + "notice": "Subscription ID to update parameters" + }, + "subscriptions(bytes32)": { + "notice": "Subscriptions indexed by their IDs" + }, + "transferOwnership(address)": { + "notice": "Overriden to be disabled" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "notice": "Calls Api3ServerV1 to update the Beacon set using the current values of its Beacons" + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "notice": "Calls Api3ServerV1 to update the Beacon using data signed by the Airnode" + }, + "updateCurrentSubscriptionId(bytes32)": { + "notice": "If the current subscription has ended, updates it with the one that will end next" + }, + "updateDapiName(bytes32,bytes32,address,bytes)": { + "notice": "Updates the dAPI name to match the respective Merkle leaf" + }, + "updateSignedApiUrl(address,string,bytes)": { + "notice": "Updates the signed API URL of the Airnode to match the respective Merkle leaf" + } + }, + "notice": "API3 aims to streamline and protocolize its integration processes through the API3 Market (https://market.api3.org), which is a data feed subscription marketplace. The Api3Market contract is the on-chain portion of this system. Api3Market enables API3 to predetermine the decisions related to its data feed services (such as the curation of data feed sources or subscription prices) and publish them on-chain. This streamlines the intergation flow, as it allows the users to initiate subscriptions immediately, without requiring any two-way communication with API3. Furthermore, this removes the need for API3 to have agents operating in the meatspace gathering order details, quoting prices and reviewing payments, and allows all such operations to be cryptographically secured with a multi-party scheme in an end-to-end manner.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 13462, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 319, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "hashes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_struct(Hash)312_storage)" + }, + { + "astId": 325, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "hashTypeToSignersHash", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_bytes32,t_bytes32)" + }, + { + "astId": 2264, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "subscriptions", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_bytes32,t_struct(Subscription)2205_storage)" + }, + { + "astId": 2270, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "dapiNameToCurrentSubscriptionId", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_bytes32)" + }, + { + "astId": 2274, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "updateParametersHashToValue", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_bytes32,t_bytes_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes32)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_bytes32,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_bytes32,t_struct(Hash)312_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct HashRegistry.Hash)", + "numberOfBytes": "32", + "value": "t_struct(Hash)312_storage" + }, + "t_mapping(t_bytes32,t_struct(Subscription)2205_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct Api3Market.Subscription)", + "numberOfBytes": "32", + "value": "t_struct(Subscription)2205_storage" + }, + "t_struct(Hash)312_storage": { + "encoding": "inplace", + "label": "struct HashRegistry.Hash", + "members": [ + { + "astId": 309, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "value", + "offset": 0, + "slot": "0", + "type": "t_bytes32" + }, + { + "astId": 311, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "timestamp", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Subscription)2205_storage": { + "encoding": "inplace", + "label": "struct Api3Market.Subscription", + "members": [ + { + "astId": 2198, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "updateParametersHash", + "offset": 0, + "slot": "0", + "type": "t_bytes32" + }, + { + "astId": 2200, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "endTimestamp", + "offset": 0, + "slot": "1", + "type": "t_uint32" + }, + { + "astId": 2202, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "dailyPrice", + "offset": 4, + "slot": "1", + "type": "t_uint224" + }, + { + "astId": 2204, + "contract": "contracts/api3-server-v1/Api3Market.sol:Api3Market", + "label": "nextSubscriptionId", + "offset": 0, + "slot": "2", + "type": "t_bytes32" + } + ], + "numberOfBytes": "96" + }, + "t_uint224": { + "encoding": "inplace", + "label": "uint224", + "numberOfBytes": "28" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} diff --git a/deployments/blast-sepolia-testnet/Api3ServerV1.json b/deployments/blast-sepolia-testnet/Api3ServerV1.json new file mode 100644 index 00000000..8c9149a0 --- /dev/null +++ b/deployments/blast-sepolia-testnet/Api3ServerV1.json @@ -0,0 +1,1137 @@ +{ + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlRegistry", + "type": "address" + }, + { + "internalType": "string", + "name": "_adminRoleDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SetDapiName", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedBeaconSetWithBeacons", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedBeaconWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedOevProxyBeaconSetWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedOevProxyBeaconWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oevProxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrew", + "type": "event" + }, + { + "inputs": [], + "name": "DAPI_NAME_SETTER_ROLE_DESCRIPTION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRoleDescription", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "containsBytecode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "dapiNameHashToDataFeedId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dapiNameSetterRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + } + ], + "name": "dapiNameToDataFeedId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "dataFeeds", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "oevProxyToBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "oevProxyToIdToDataFeed", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiNameHash", + "type": "bytes32" + } + ], + "name": "readDataFeedWithDapiNameHash", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiNameHash", + "type": "bytes32" + } + ], + "name": "readDataFeedWithDapiNameHashAsOevProxy", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "readDataFeedWithId", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "readDataFeedWithIdAsOevProxy", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "setDapiName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "beaconIds", + "type": "bytes32[]" + } + ], + "name": "updateBeaconSetWithBeacons", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "airnode", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "templateId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "updateBeaconWithSignedData", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oevProxy", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "packedOevUpdateSignatures", + "type": "bytes[]" + } + ], + "name": "updateOevProxyDataFeedWithSignedData", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oevProxy", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x235d34ca38705c3fbc776166d40834aec72120ad58d813af2c52e9f35e4f52fc", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 3, + "gasUsed": "2961690", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xae955b7dbd00c459ce9a46d953e5a8f054637f047b461b9bf05a1bc7fbe0657e", + "transactionHash": "0x235d34ca38705c3fbc776166d40834aec72120ad58d813af2c52e9f35e4f52fc", + "logs": [], + "blockNumber": 1693147, + "cumulativeGasUsed": "3173307", + "status": 1, + "byzantium": true + }, + "args": [ + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "Api3ServerV1 admin", + "0x81bc85f329cDB28936FbB239f734AE495121F9A6" + ], + "numDeployments": 1, + "solcInputHash": "9a9784f0166e92dcfa54df2d2c909051", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlRegistry\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_adminRoleDescription\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDapiName\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedBeaconSetWithBeacons\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedBeaconWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedOevProxyBeaconSetWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedOevProxyBeaconWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DAPI_NAME_SETTER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"containsBytecode\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dapiNameHashToDataFeedId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dapiNameSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"}],\"name\":\"dapiNameToDataFeedId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"dataFeeds\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"oevProxyToBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"oevProxyToIdToDataFeed\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiNameHash\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithDapiNameHash\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiNameHash\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithDapiNameHashAsOevProxy\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithId\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithIdAsOevProxy\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"setDapiName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"beaconIds\",\"type\":\"bytes32[]\"}],\"name\":\"updateBeaconSetWithBeacons\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"templateId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateBeaconWithSignedData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"packedOevUpdateSignatures\",\"type\":\"bytes[]\"}],\"name\":\"updateOevProxyDataFeedWithSignedData\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\"}},\"containsBytecode(address)\":{\"details\":\"An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.\",\"returns\":{\"_0\":\"If the account contains bytecode\"}},\"dapiNameToDataFeedId(bytes32)\":{\"params\":{\"dapiName\":\"dAPI name\"},\"returns\":{\"_0\":\"Data feed ID\"}},\"getBalance(address)\":{\"params\":{\"account\":\"Account address\"},\"returns\":{\"_0\":\"Account balance\"}},\"getBlockBasefee()\":{\"returns\":{\"_0\":\"Current block basefee\"}},\"getBlockNumber()\":{\"returns\":{\"_0\":\"Current block number\"}},\"getBlockTimestamp()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"getChainId()\":{\"returns\":{\"_0\":\"Chain ID\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"readDataFeedWithDapiNameHash(bytes32)\":{\"params\":{\"dapiNameHash\":\"dAPI name hash\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithDapiNameHashAsOevProxy(bytes32)\":{\"params\":{\"dapiNameHash\":\"dAPI name hash\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithId(bytes32)\":{\"params\":{\"dataFeedId\":\"Data feed ID\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithIdAsOevProxy(bytes32)\":{\"params\":{\"dataFeedId\":\"Data feed ID\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"setDapiName(bytes32,bytes32)\":{\"details\":\"While a data feed ID refers to a specific Beacon or Beacon set, dAPI names provide a more abstract interface for convenience. This means a dAPI name that was pointing to a Beacon can be pointed to a Beacon set, then another Beacon set, etc.\",\"params\":{\"dapiName\":\"Human-readable dAPI name\",\"dataFeedId\":\"Data feed ID the dAPI name will point to\"}},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}},\"updateBeaconSetWithBeacons(bytes32[])\":{\"details\":\"As an oddity, this function still works if some of the IDs in `beaconIds` belong to Beacon sets rather than Beacons. This can be used to implement hierarchical Beacon sets.\",\"params\":{\"beaconIds\":\"Beacon IDs\"},\"returns\":{\"beaconSetId\":\"Beacon set ID\"}},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"details\":\"The signed data here is intentionally very general for practical reasons. It is less demanding on the signer to have data signed once and use that everywhere.\",\"params\":{\"airnode\":\"Airnode address\",\"data\":\"Update data (an `int256` encoded in contract ABI)\",\"signature\":\"Template ID, timestamp and the update data signed by the Airnode\",\"templateId\":\"Template ID\",\"timestamp\":\"Signature timestamp\"},\"returns\":{\"beaconId\":\"Updated Beacon ID\"}},\"updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])\":{\"details\":\"For when the data feed being updated is a Beacon set, an absolute majority of the Airnodes that power the respective Beacons must sign the aggregated value and timestamp. While doing so, the Airnodes should refer to data signed to update an absolute majority of the respective Beacons. The Airnodes should require the data to be fresh enough (e.g., at most 2 minutes-old), and tightly distributed around the resulting aggregation (e.g., within 1% deviation), and reject to provide an OEV proxy data feed update signature if these are not satisfied.\",\"params\":{\"data\":\"Update data (an `int256` encoded in contract ABI)\",\"dataFeedId\":\"Data feed ID\",\"oevProxy\":\"OEV proxy that reads the data feed\",\"packedOevUpdateSignatures\":\"Packed OEV update signatures, which include the Airnode address, template ID and these signed with the OEV update hash\",\"timestamp\":\"Signature timestamp\",\"updateId\":\"Update ID\"}},\"withdraw(address)\":{\"details\":\"This does not require the caller to be the beneficiary because we expect that in most cases, the OEV beneficiary will be a contract that will not be able to make arbitrary calls. Our choice can be worked around by implementing a beneficiary proxy.\",\"params\":{\"oevProxy\":\"OEV proxy\"}}},\"title\":\"First version of the contract that API3 uses to serve data feeds\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DAPI_NAME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"dAPI name setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"containsBytecode(address)\":{\"notice\":\"Returns if the account contains bytecode\"},\"dapiNameHashToDataFeedId(bytes32)\":{\"notice\":\"dAPI name hash mapped to the data feed ID\"},\"dapiNameSetterRole()\":{\"notice\":\"dAPI name setter role\"},\"dapiNameToDataFeedId(bytes32)\":{\"notice\":\"Returns the data feed ID the dAPI name is set to\"},\"getBalance(address)\":{\"notice\":\"Returns the account balance\"},\"getBlockBasefee()\":{\"notice\":\"Returns the current block basefee\"},\"getBlockNumber()\":{\"notice\":\"Returns the current block number\"},\"getBlockTimestamp()\":{\"notice\":\"Returns the current block timestamp\"},\"getChainId()\":{\"notice\":\"Returns the chain ID\"},\"manager()\":{\"notice\":\"Address of the manager that manages the related AccessControlRegistry roles\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"oevProxyToBalance(address)\":{\"notice\":\"Accumulated OEV auction proceeds for the specific proxy\"},\"readDataFeedWithDapiNameHash(bytes32)\":{\"notice\":\"Reads the data feed with dAPI name hash\"},\"readDataFeedWithDapiNameHashAsOevProxy(bytes32)\":{\"notice\":\"Reads the data feed as the OEV proxy with dAPI name hash\"},\"readDataFeedWithId(bytes32)\":{\"notice\":\"Reads the data feed with ID\"},\"readDataFeedWithIdAsOevProxy(bytes32)\":{\"notice\":\"Reads the data feed as the OEV proxy with ID\"},\"setDapiName(bytes32,bytes32)\":{\"notice\":\"Sets the data feed ID the dAPI name points to\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateBeaconSetWithBeacons(bytes32[])\":{\"notice\":\"Updates the Beacon set using the current values of its Beacons\"},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"notice\":\"Updates a Beacon using data signed by the Airnode\"},\"updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])\":{\"notice\":\"Updates a data feed that the OEV proxy reads using the aggregation signed by the absolute majority of the respective Airnodes for the specific bid\"},\"withdraw(address)\":{\"notice\":\"Withdraws the balance of the OEV proxy to the respective beneficiary account\"}},\"notice\":\"Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets, dAPIs, with optional OEV support for all of these. The base Beacons are only updateable using signed data, and the Beacon sets are updateable based on the Beacons, optionally using PSP. OEV proxy Beacons and Beacon sets are updateable using OEV-signed data. Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/api3-server-v1/Api3ServerV1.sol\":\"Api3ServerV1\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/access/AccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/SelfMulticall.sol\\\";\\nimport \\\"./RoleDeriver.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistry.sol\\\";\\n\\n/// @title Contract to be inherited by contracts whose adminship functionality\\n/// will be implemented using AccessControlRegistry\\ncontract AccessControlRegistryAdminned is\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistryAdminned\\n{\\n /// @notice AccessControlRegistry contract address\\n address public immutable override accessControlRegistry;\\n\\n /// @notice Admin role description\\n string public override adminRoleDescription;\\n\\n bytes32 internal immutable adminRoleDescriptionHash;\\n\\n /// @dev Contracts deployed with the same admin role descriptions will have\\n /// the same roles, meaning that granting an account a role will authorize\\n /// it in multiple contracts. Unless you want your deployed contract to\\n /// share the role configuration of another contract, use a unique admin\\n /// role description.\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription\\n ) {\\n require(_accessControlRegistry != address(0), \\\"ACR address zero\\\");\\n require(\\n bytes(_adminRoleDescription).length > 0,\\n \\\"Admin role description empty\\\"\\n );\\n accessControlRegistry = _accessControlRegistry;\\n adminRoleDescription = _adminRoleDescription;\\n adminRoleDescriptionHash = keccak256(\\n abi.encodePacked(_adminRoleDescription)\\n );\\n }\\n\\n /// @notice Derives the admin role for the specific manager address\\n /// @param manager Manager address\\n /// @return adminRole Admin role\\n function _deriveAdminRole(\\n address manager\\n ) internal view returns (bytes32 adminRole) {\\n adminRole = _deriveRole(\\n _deriveRootRole(manager),\\n adminRoleDescriptionHash\\n );\\n }\\n}\\n\",\"keccak256\":\"0x813755d99a9d8dd6298720da68fb5a6dd69329ea2dec91da1d09f715d4543c15\",\"license\":\"MIT\"},\"contracts/access/AccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./AccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\n/// @title Contract to be inherited by contracts with manager whose adminship\\n/// functionality will be implemented using AccessControlRegistry\\n/// @notice The manager address here is expected to belong to an\\n/// AccessControlRegistry user that is a multisig/DAO\\ncontract AccessControlRegistryAdminnedWithManager is\\n AccessControlRegistryAdminned,\\n IAccessControlRegistryAdminnedWithManager\\n{\\n /// @notice Address of the manager that manages the related\\n /// AccessControlRegistry roles\\n /// @dev The mutability of the manager role can be implemented by\\n /// designating an OwnableCallForwarder contract as the manager. The\\n /// ownership of this contract can then be transferred, effectively\\n /// transferring managership.\\n address public immutable override manager;\\n\\n /// @notice Admin role\\n /// @dev Since `manager` is immutable, so is `adminRole`\\n bytes32 public immutable override adminRole;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminned(\\n _accessControlRegistry,\\n _adminRoleDescription\\n )\\n {\\n require(_manager != address(0), \\\"Manager address zero\\\");\\n manager = _manager;\\n adminRole = _deriveAdminRole(_manager);\\n }\\n}\\n\",\"keccak256\":\"0xbe5df884327dd7d4e236c105b6ef52cc6db20b452f4cdbe6c50fa506ed66cace\",\"license\":\"MIT\"},\"contracts/access/RoleDeriver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will derive\\n/// AccessControlRegistry roles\\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\\n/// derive roles, it should inherit this contract instead of re-implementing\\n/// the logic\\ncontract RoleDeriver {\\n /// @notice Derives the root role of the manager\\n /// @param manager Manager address\\n /// @return rootRole Root role\\n function _deriveRootRole(\\n address manager\\n ) internal pure returns (bytes32 rootRole) {\\n rootRole = keccak256(abi.encodePacked(manager));\\n }\\n\\n /// @notice Derives the role using its admin role and description\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param description Human-readable description of the role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n string memory description\\n ) internal pure returns (bytes32 role) {\\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\\n }\\n\\n /// @notice Derives the role using its admin role and description hash\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param descriptionHash Hash of the human-readable description of the\\n /// role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n bytes32 descriptionHash\\n ) internal pure returns (bytes32 role) {\\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\\n }\\n}\\n\",\"keccak256\":\"0x488adb3cb7031415d4a195230753a0ac8f9f610e6db7a571529a350e29c97ed6\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\\n event InitializedManager(\\n bytes32 indexed rootRole,\\n address indexed manager,\\n address sender\\n );\\n\\n event InitializedRole(\\n bytes32 indexed role,\\n bytes32 indexed adminRole,\\n string description,\\n address sender\\n );\\n\\n function initializeManager(address manager) external;\\n\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external returns (bytes32 role);\\n}\\n\",\"keccak256\":\"0x87066db894a24118df39a557d00c0a6529c39196011c03f809ca8cce1644e027\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/api3-server-v1/Api3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./OevDapiServer.sol\\\";\\nimport \\\"./BeaconUpdatesWithSignedData.sol\\\";\\nimport \\\"./interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title First version of the contract that API3 uses to serve data feeds\\n/// @notice Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets,\\n/// dAPIs, with optional OEV support for all of these.\\n/// The base Beacons are only updateable using signed data, and the Beacon sets\\n/// are updateable based on the Beacons, optionally using PSP. OEV proxy\\n/// Beacons and Beacon sets are updateable using OEV-signed data.\\n/// Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\\ncontract Api3ServerV1 is\\n OevDapiServer,\\n BeaconUpdatesWithSignedData,\\n IApi3ServerV1\\n{\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n ) OevDapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\\n\\n /// @notice Reads the data feed with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithId(dataFeedId);\\n }\\n\\n /// @notice Reads the data feed with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithDapiNameHash(dapiNameHash);\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithIdAsOevProxy(dataFeedId);\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\\n }\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _oevProxyToIdToDataFeed[proxy][dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0xa9100269a781dbc267a1de630d333b475efc13cc87bf906de23c21a972a03f41\",\"license\":\"MIT\"},\"contracts/api3-server-v1/BeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IBeaconUpdatesWithSignedData.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title Contract that updates Beacons using signed data\\ncontract BeaconUpdatesWithSignedData is\\n DataFeedServer,\\n IBeaconUpdatesWithSignedData\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Updates a Beacon using data signed by the Airnode\\n /// @dev The signed data here is intentionally very general for practical\\n /// reasons. It is less demanding on the signer to have data signed once\\n /// and use that everywhere.\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @param timestamp Signature timestamp\\n /// @param data Update data (an `int256` encoded in contract ABI)\\n /// @param signature Template ID, timestamp and the update data signed by\\n /// the Airnode\\n /// @return beaconId Updated Beacon ID\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external override returns (bytes32 beaconId) {\\n require(\\n (\\n keccak256(abi.encodePacked(templateId, timestamp, data))\\n .toEthSignedMessageHash()\\n ).recover(signature) == airnode,\\n \\\"Signature mismatch\\\"\\n );\\n beaconId = deriveBeaconId(airnode, templateId);\\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\\n emit UpdatedBeaconWithSignedData(\\n beaconId,\\n updatedValue,\\n uint32(timestamp)\\n );\\n }\\n}\\n\",\"keccak256\":\"0xc5caacfa234d89c20a1e4493acbe6256c684558deb5a57a25cfb6314e99895be\",\"license\":\"MIT\"},\"contracts/api3-server-v1/DapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IDapiServer.sol\\\";\\n\\n/// @title Contract that serves dAPIs mapped to Beacons and Beacon sets\\n/// @notice Beacons and Beacon sets are addressed by immutable IDs. Although\\n/// this is trust-minimized, it requires users to manage the ID of the data\\n/// feed they are using. For when the user does not want to do this, dAPIs can\\n/// be used as an abstraction layer. By using a dAPI, the user delegates this\\n/// responsibility to dAPI management. It is important for dAPI management to\\n/// be restricted by consensus rules (by using a multisig or a DAO) and similar\\n/// trustless security mechanisms.\\ncontract DapiServer is\\n AccessControlRegistryAdminnedWithManager,\\n DataFeedServer,\\n IDapiServer\\n{\\n /// @notice dAPI name setter role description\\n string public constant override DAPI_NAME_SETTER_ROLE_DESCRIPTION =\\n \\\"dAPI name setter\\\";\\n\\n /// @notice dAPI name setter role\\n bytes32 public immutable override dapiNameSetterRole;\\n\\n /// @notice dAPI name hash mapped to the data feed ID\\n mapping(bytes32 => bytes32) public override dapiNameHashToDataFeedId;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n dapiNameSetterRole = _deriveRole(\\n _deriveAdminRole(manager),\\n DAPI_NAME_SETTER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Sets the data feed ID the dAPI name points to\\n /// @dev While a data feed ID refers to a specific Beacon or Beacon set,\\n /// dAPI names provide a more abstract interface for convenience. This\\n /// means a dAPI name that was pointing to a Beacon can be pointed to a\\n /// Beacon set, then another Beacon set, etc.\\n /// @param dapiName Human-readable dAPI name\\n /// @param dataFeedId Data feed ID the dAPI name will point to\\n function setDapiName(\\n bytes32 dapiName,\\n bytes32 dataFeedId\\n ) external override {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n dapiNameSetterRole,\\n msg.sender\\n ),\\n \\\"Sender cannot set dAPI name\\\"\\n );\\n dapiNameHashToDataFeedId[\\n keccak256(abi.encodePacked(dapiName))\\n ] = dataFeedId;\\n emit SetDapiName(dataFeedId, dapiName, msg.sender);\\n }\\n\\n /// @notice Returns the data feed ID the dAPI name is set to\\n /// @param dapiName dAPI name\\n /// @return Data feed ID\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view override returns (bytes32) {\\n return dapiNameHashToDataFeedId[keccak256(abi.encodePacked(dapiName))];\\n }\\n\\n /// @notice Reads the data feed with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) internal view returns (int224 value, uint32 timestamp) {\\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\\n require(dataFeedId != bytes32(0), \\\"dAPI name not set\\\");\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n}\\n\",\"keccak256\":\"0x20e4e9b35f34df76875cc2cdc1524f98aaf7002022ea248d5dd7b8c8640716f4\",\"license\":\"MIT\"},\"contracts/api3-server-v1/DataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../utils/ExtendedSelfMulticall.sol\\\";\\nimport \\\"./aggregation/Median.sol\\\";\\nimport \\\"./interfaces/IDataFeedServer.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title Contract that serves Beacons and Beacon sets\\n/// @notice A Beacon is a live data feed addressed by an ID, which is derived\\n/// from an Airnode address and a template ID. This is suitable where the more\\n/// recent data point is always more favorable, e.g., in the context of an\\n/// asset price data feed. Beacons can also be seen as one-Airnode data feeds\\n/// that can be used individually or combined to build Beacon sets.\\ncontract DataFeedServer is ExtendedSelfMulticall, Median, IDataFeedServer {\\n using ECDSA for bytes32;\\n\\n // Airnodes serve their fulfillment data along with timestamps. This\\n // contract casts the reported data to `int224` and the timestamp to\\n // `uint32`, which works until year 2106.\\n struct DataFeed {\\n int224 value;\\n uint32 timestamp;\\n }\\n\\n /// @notice Data feed with ID\\n mapping(bytes32 => DataFeed) internal _dataFeeds;\\n\\n /// @dev Reverts if the timestamp is from more than 1 hour in the future\\n modifier onlyValidTimestamp(uint256 timestamp) virtual {\\n unchecked {\\n require(\\n timestamp < block.timestamp + 1 hours,\\n \\\"Timestamp not valid\\\"\\n );\\n }\\n _;\\n }\\n\\n /// @notice Updates the Beacon set using the current values of its Beacons\\n /// @dev As an oddity, this function still works if some of the IDs in\\n /// `beaconIds` belong to Beacon sets rather than Beacons. This can be used\\n /// to implement hierarchical Beacon sets.\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Beacon set ID\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) public override returns (bytes32 beaconSetId) {\\n (int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(\\n beaconIds\\n );\\n beaconSetId = deriveBeaconSetId(beaconIds);\\n DataFeed storage beaconSet = _dataFeeds[beaconSetId];\\n if (beaconSet.timestamp == updatedTimestamp) {\\n require(\\n beaconSet.value != updatedValue,\\n \\\"Does not update Beacon set\\\"\\n );\\n }\\n _dataFeeds[beaconSetId] = DataFeed({\\n value: updatedValue,\\n timestamp: updatedTimestamp\\n });\\n emit UpdatedBeaconSetWithBeacons(\\n beaconSetId,\\n updatedValue,\\n updatedTimestamp\\n );\\n }\\n\\n /// @notice Reads the data feed with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithId(\\n bytes32 dataFeedId\\n ) internal view returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n\\n /// @notice Derives the Beacon ID from the Airnode address and template ID\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @return beaconId Beacon ID\\n function deriveBeaconId(\\n address airnode,\\n bytes32 templateId\\n ) internal pure returns (bytes32 beaconId) {\\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\\n }\\n\\n /// @notice Derives the Beacon set ID from the Beacon IDs\\n /// @dev Notice that `abi.encode()` is used over `abi.encodePacked()`\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Beacon set ID\\n function deriveBeaconSetId(\\n bytes32[] memory beaconIds\\n ) internal pure returns (bytes32 beaconSetId) {\\n beaconSetId = keccak256(abi.encode(beaconIds));\\n }\\n\\n /// @notice Called privately to process the Beacon update\\n /// @param beaconId Beacon ID\\n /// @param timestamp Timestamp used in the signature\\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\\n /// @return updatedBeaconValue Updated Beacon value\\n function processBeaconUpdate(\\n bytes32 beaconId,\\n uint256 timestamp,\\n bytes calldata data\\n )\\n internal\\n onlyValidTimestamp(timestamp)\\n returns (int224 updatedBeaconValue)\\n {\\n updatedBeaconValue = decodeFulfillmentData(data);\\n require(\\n timestamp > _dataFeeds[beaconId].timestamp,\\n \\\"Does not update timestamp\\\"\\n );\\n _dataFeeds[beaconId] = DataFeed({\\n value: updatedBeaconValue,\\n timestamp: uint32(timestamp)\\n });\\n }\\n\\n /// @notice Called privately to decode the fulfillment data\\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\\n /// @return decodedData Decoded fulfillment data\\n function decodeFulfillmentData(\\n bytes memory data\\n ) internal pure returns (int224) {\\n require(data.length == 32, \\\"Data length not correct\\\");\\n int256 decodedData = abi.decode(data, (int256));\\n require(\\n decodedData >= type(int224).min && decodedData <= type(int224).max,\\n \\\"Value typecasting error\\\"\\n );\\n return int224(decodedData);\\n }\\n\\n /// @notice Called privately to aggregate the Beacons and return the result\\n /// @param beaconIds Beacon IDs\\n /// @return value Aggregation value\\n /// @return timestamp Aggregation timestamp\\n function aggregateBeacons(\\n bytes32[] memory beaconIds\\n ) internal view returns (int224 value, uint32 timestamp) {\\n uint256 beaconCount = beaconIds.length;\\n require(beaconCount > 1, \\\"Specified less than two Beacons\\\");\\n int256[] memory values = new int256[](beaconCount);\\n int256[] memory timestamps = new int256[](beaconCount);\\n for (uint256 ind = 0; ind < beaconCount; ) {\\n DataFeed storage dataFeed = _dataFeeds[beaconIds[ind]];\\n values[ind] = dataFeed.value;\\n timestamps[ind] = int256(uint256(dataFeed.timestamp));\\n unchecked {\\n ind++;\\n }\\n }\\n value = int224(median(values));\\n timestamp = uint32(uint256(median(timestamps)));\\n }\\n}\\n\",\"keccak256\":\"0xff3172da608fcaa59f17557ff06f8355a90d8cf87c3b3a91b8405ec122a064e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/OevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./OevDataFeedServer.sol\\\";\\nimport \\\"./DapiServer.sol\\\";\\nimport \\\"./interfaces/IOevDapiServer.sol\\\";\\n\\n/// @title Contract that serves OEV dAPIs\\ncontract OevDapiServer is OevDataFeedServer, DapiServer, IOevDapiServer {\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n ) DapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\\n\\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) internal view returns (int224 value, uint32 timestamp) {\\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\\n require(dataFeedId != bytes32(0), \\\"dAPI name not set\\\");\\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\\n dataFeedId\\n ];\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\\n } else {\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n}\\n\",\"keccak256\":\"0x7e506b1a9248563d4873159a40e5c2ce46ad0e24ad833d62610669a7dea8f137\",\"license\":\"MIT\"},\"contracts/api3-server-v1/OevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IOevDataFeedServer.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"./proxies/interfaces/IOevProxy.sol\\\";\\n\\n/// @title Contract that serves OEV Beacons and Beacon sets\\n/// @notice OEV Beacons and Beacon sets can be updated by the winner of the\\n/// respective OEV auctions. The beneficiary can withdraw the proceeds from\\n/// this contract.\\ncontract OevDataFeedServer is DataFeedServer, IOevDataFeedServer {\\n using ECDSA for bytes32;\\n\\n /// @notice Data feed with ID specific to the OEV proxy\\n /// @dev This implies that an update as a result of an OEV auction only\\n /// affects contracts that read through the respective proxy that the\\n /// auction was being held for\\n mapping(address => mapping(bytes32 => DataFeed))\\n internal _oevProxyToIdToDataFeed;\\n\\n /// @notice Accumulated OEV auction proceeds for the specific proxy\\n mapping(address => uint256) public override oevProxyToBalance;\\n\\n /// @notice Updates a data feed that the OEV proxy reads using the\\n /// aggregation signed by the absolute majority of the respective Airnodes\\n /// for the specific bid\\n /// @dev For when the data feed being updated is a Beacon set, an absolute\\n /// majority of the Airnodes that power the respective Beacons must sign\\n /// the aggregated value and timestamp. While doing so, the Airnodes should\\n /// refer to data signed to update an absolute majority of the respective\\n /// Beacons. The Airnodes should require the data to be fresh enough (e.g.,\\n /// at most 2 minutes-old), and tightly distributed around the resulting\\n /// aggregation (e.g., within 1% deviation), and reject to provide an OEV\\n /// proxy data feed update signature if these are not satisfied.\\n /// @param oevProxy OEV proxy that reads the data feed\\n /// @param dataFeedId Data feed ID\\n /// @param updateId Update ID\\n /// @param timestamp Signature timestamp\\n /// @param data Update data (an `int256` encoded in contract ABI)\\n /// @param packedOevUpdateSignatures Packed OEV update signatures, which\\n /// include the Airnode address, template ID and these signed with the OEV\\n /// update hash\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable override onlyValidTimestamp(timestamp) {\\n require(\\n timestamp > _oevProxyToIdToDataFeed[oevProxy][dataFeedId].timestamp,\\n \\\"Does not update timestamp\\\"\\n );\\n bytes32 oevUpdateHash = keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n oevProxy,\\n dataFeedId,\\n updateId,\\n timestamp,\\n data,\\n msg.sender,\\n msg.value\\n )\\n );\\n int224 updatedValue = decodeFulfillmentData(data);\\n uint32 updatedTimestamp = uint32(timestamp);\\n uint256 beaconCount = packedOevUpdateSignatures.length;\\n if (beaconCount > 1) {\\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\\n uint256 validSignatureCount;\\n for (uint256 ind = 0; ind < beaconCount; ) {\\n bool signatureIsNotOmitted;\\n (\\n signatureIsNotOmitted,\\n beaconIds[ind]\\n ) = unpackAndValidateOevUpdateSignature(\\n oevUpdateHash,\\n packedOevUpdateSignatures[ind]\\n );\\n if (signatureIsNotOmitted) {\\n unchecked {\\n validSignatureCount++;\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n // \\\"Greater than or equal to\\\" is not enough because full control\\n // of aggregation requires an absolute majority\\n require(\\n validSignatureCount > beaconCount / 2,\\n \\\"Not enough signatures\\\"\\n );\\n require(\\n dataFeedId == deriveBeaconSetId(beaconIds),\\n \\\"Beacon set ID mismatch\\\"\\n );\\n emit UpdatedOevProxyBeaconSetWithSignedData(\\n dataFeedId,\\n oevProxy,\\n updateId,\\n updatedValue,\\n updatedTimestamp\\n );\\n } else if (beaconCount == 1) {\\n {\\n (\\n bool signatureIsNotOmitted,\\n bytes32 beaconId\\n ) = unpackAndValidateOevUpdateSignature(\\n oevUpdateHash,\\n packedOevUpdateSignatures[0]\\n );\\n require(signatureIsNotOmitted, \\\"Missing signature\\\");\\n require(dataFeedId == beaconId, \\\"Beacon ID mismatch\\\");\\n }\\n emit UpdatedOevProxyBeaconWithSignedData(\\n dataFeedId,\\n oevProxy,\\n updateId,\\n updatedValue,\\n updatedTimestamp\\n );\\n } else {\\n revert(\\\"Did not specify any Beacons\\\");\\n }\\n _oevProxyToIdToDataFeed[oevProxy][dataFeedId] = DataFeed({\\n value: updatedValue,\\n timestamp: updatedTimestamp\\n });\\n oevProxyToBalance[oevProxy] += msg.value;\\n }\\n\\n /// @notice Withdraws the balance of the OEV proxy to the respective\\n /// beneficiary account\\n /// @dev This does not require the caller to be the beneficiary because we\\n /// expect that in most cases, the OEV beneficiary will be a contract that\\n /// will not be able to make arbitrary calls. Our choice can be worked\\n /// around by implementing a beneficiary proxy.\\n /// @param oevProxy OEV proxy\\n function withdraw(address oevProxy) external override {\\n address oevBeneficiary = IOevProxy(oevProxy).oevBeneficiary();\\n require(oevBeneficiary != address(0), \\\"Beneficiary address zero\\\");\\n uint256 balance = oevProxyToBalance[oevProxy];\\n require(balance != 0, \\\"OEV proxy balance zero\\\");\\n oevProxyToBalance[oevProxy] = 0;\\n emit Withdrew(oevProxy, oevBeneficiary, balance);\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, ) = oevBeneficiary.call{value: balance}(\\\"\\\");\\n require(success, \\\"Withdrawal reverted\\\");\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) internal view returns (int224 value, uint32 timestamp) {\\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\\n dataFeedId\\n ];\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\\n } else {\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n\\n /// @notice Called privately to unpack and validate the OEV update\\n /// signature\\n /// @param oevUpdateHash OEV update hash\\n /// @param packedOevUpdateSignature Packed OEV update signature, which\\n /// includes the Airnode address, template ID and these signed with the OEV\\n /// update hash\\n /// @return signatureIsNotOmitted If the signature is omitted in\\n /// `packedOevUpdateSignature`\\n /// @return beaconId Beacon ID\\n function unpackAndValidateOevUpdateSignature(\\n bytes32 oevUpdateHash,\\n bytes calldata packedOevUpdateSignature\\n ) private pure returns (bool signatureIsNotOmitted, bytes32 beaconId) {\\n (address airnode, bytes32 templateId, bytes memory signature) = abi\\n .decode(packedOevUpdateSignature, (address, bytes32, bytes));\\n beaconId = deriveBeaconId(airnode, templateId);\\n if (signature.length != 0) {\\n require(\\n (\\n keccak256(abi.encodePacked(oevUpdateHash, templateId))\\n .toEthSignedMessageHash()\\n ).recover(signature) == airnode,\\n \\\"Signature mismatch\\\"\\n );\\n signatureIsNotOmitted = true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4e8557b0ab232ac721adfedecedb5e182548e04f64794854330d6251d98c538b\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/Median.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Sort.sol\\\";\\nimport \\\"./QuickSelect.sol\\\";\\n\\n/// @title Contract to be inherited by contracts that will calculate the median\\n/// of an array\\n/// @notice The operation will be in-place, i.e., the array provided as the\\n/// argument will be modified.\\ncontract Median is Sort, Quickselect {\\n /// @notice Returns the median of the array\\n /// @dev Uses an unrolled sorting implementation for shorter arrays and\\n /// quickselect for longer arrays for gas cost efficiency\\n /// @param array Array whose median is to be calculated\\n /// @return Median of the array\\n function median(int256[] memory array) internal pure returns (int256) {\\n uint256 arrayLength = array.length;\\n if (arrayLength <= MAX_SORT_LENGTH) {\\n sort(array);\\n if (arrayLength % 2 == 1) {\\n return array[arrayLength / 2];\\n } else {\\n assert(arrayLength != 0);\\n unchecked {\\n return\\n average(\\n array[arrayLength / 2 - 1],\\n array[arrayLength / 2]\\n );\\n }\\n }\\n } else {\\n if (arrayLength % 2 == 1) {\\n return array[quickselectK(array, arrayLength / 2)];\\n } else {\\n uint256 mid1;\\n uint256 mid2;\\n unchecked {\\n (mid1, mid2) = quickselectKPlusOne(\\n array,\\n arrayLength / 2 - 1\\n );\\n }\\n return average(array[mid1], array[mid2]);\\n }\\n }\\n }\\n\\n /// @notice Averages two signed integers without overflowing\\n /// @param x Integer x\\n /// @param y Integer y\\n /// @return Average of integers x and y\\n function average(int256 x, int256 y) private pure returns (int256) {\\n unchecked {\\n int256 averageRoundedDownToNegativeInfinity = (x >> 1) +\\n (y >> 1) +\\n (x & y & 1);\\n // If the average rounded down to negative infinity is negative\\n // (i.e., its 256th sign bit is set), and one of (x, y) is even and\\n // the other one is odd (i.e., the 1st bit of their xor is set),\\n // add 1 to round the average down to zero instead.\\n // We will typecast the signed integer to unsigned to logical-shift\\n // int256(uint256(signedInt)) >> 255 ~= signedInt >>> 255\\n return\\n averageRoundedDownToNegativeInfinity +\\n (int256(\\n (uint256(averageRoundedDownToNegativeInfinity) >> 255)\\n ) & (x ^ y));\\n }\\n }\\n}\\n\",\"keccak256\":\"0x84912d10ad5fa4848f2dfbbac40431ccdeb5250c263718b5fbdfeceeb0946524\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/QuickSelect.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will calculate the index\\n/// of the k-th and optionally (k+1)-th largest elements in the array\\n/// @notice Uses quickselect, which operates in-place, i.e., the array provided\\n/// as the argument will be modified.\\ncontract Quickselect {\\n /// @notice Returns the index of the k-th largest element in the array\\n /// @param array Array in which k-th largest element will be searched\\n /// @param k K\\n /// @return indK Index of the k-th largest element\\n function quickselectK(\\n int256[] memory array,\\n uint256 k\\n ) internal pure returns (uint256 indK) {\\n uint256 arrayLength = array.length;\\n assert(arrayLength > 0);\\n unchecked {\\n (indK, ) = quickselect(array, 0, arrayLength - 1, k, false);\\n }\\n }\\n\\n /// @notice Returns the index of the k-th and (k+1)-th largest elements in\\n /// the array\\n /// @param array Array in which k-th and (k+1)-th largest elements will be\\n /// searched\\n /// @param k K\\n /// @return indK Index of the k-th largest element\\n /// @return indKPlusOne Index of the (k+1)-th largest element\\n function quickselectKPlusOne(\\n int256[] memory array,\\n uint256 k\\n ) internal pure returns (uint256 indK, uint256 indKPlusOne) {\\n uint256 arrayLength = array.length;\\n assert(arrayLength > 1);\\n unchecked {\\n (indK, indKPlusOne) = quickselect(\\n array,\\n 0,\\n arrayLength - 1,\\n k,\\n true\\n );\\n }\\n }\\n\\n /// @notice Returns the index of the k-th largest element in the specified\\n /// section of the (potentially unsorted) array\\n /// @param array Array in which K will be searched for\\n /// @param lo Starting index of the section of the array that K will be\\n /// searched in\\n /// @param hi Last index of the section of the array that K will be\\n /// searched in\\n /// @param k K\\n /// @param selectKPlusOne If the index of the (k+1)-th largest element is\\n /// to be returned\\n /// @return indK Index of the k-th largest element\\n /// @return indKPlusOne Index of the (k+1)-th largest element (only set if\\n /// `selectKPlusOne` is `true`)\\n function quickselect(\\n int256[] memory array,\\n uint256 lo,\\n uint256 hi,\\n uint256 k,\\n bool selectKPlusOne\\n ) private pure returns (uint256 indK, uint256 indKPlusOne) {\\n if (lo == hi) {\\n return (k, 0);\\n }\\n uint256 indPivot = partition(array, lo, hi);\\n if (k < indPivot) {\\n unchecked {\\n (indK, ) = quickselect(array, lo, indPivot - 1, k, false);\\n }\\n } else if (k > indPivot) {\\n unchecked {\\n (indK, ) = quickselect(array, indPivot + 1, hi, k, false);\\n }\\n } else {\\n indK = indPivot;\\n }\\n // Since Quickselect ends in the array being partitioned around the\\n // k-th largest element, we can continue searching towards right for\\n // the (k+1)-th largest element, which is useful in calculating the\\n // median of an array with even length\\n if (selectKPlusOne) {\\n unchecked {\\n indKPlusOne = indK + 1;\\n }\\n uint256 i;\\n unchecked {\\n i = indKPlusOne + 1;\\n }\\n uint256 arrayLength = array.length;\\n for (; i < arrayLength; ) {\\n if (array[i] < array[indKPlusOne]) {\\n indKPlusOne = i;\\n }\\n unchecked {\\n i++;\\n }\\n }\\n }\\n }\\n\\n /// @notice Partitions the array into two around a pivot\\n /// @param array Array that will be partitioned\\n /// @param lo Starting index of the section of the array that will be\\n /// partitioned\\n /// @param hi Last index of the section of the array that will be\\n /// partitioned\\n /// @return pivotInd Pivot index\\n function partition(\\n int256[] memory array,\\n uint256 lo,\\n uint256 hi\\n ) private pure returns (uint256 pivotInd) {\\n if (lo == hi) {\\n return lo;\\n }\\n int256 pivot = array[lo];\\n uint256 i = lo;\\n unchecked {\\n pivotInd = hi + 1;\\n }\\n while (true) {\\n do {\\n unchecked {\\n i++;\\n }\\n } while (i < array.length && array[i] < pivot);\\n do {\\n unchecked {\\n pivotInd--;\\n }\\n } while (array[pivotInd] > pivot);\\n if (i >= pivotInd) {\\n (array[lo], array[pivotInd]) = (array[pivotInd], array[lo]);\\n return pivotInd;\\n }\\n (array[i], array[pivotInd]) = (array[pivotInd], array[i]);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7f458dd165fed89866c5fe626e3df3c9bf6884498ec1233f4083615084521d6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/Sort.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will sort an array using\\n/// an unrolled implementation\\n/// @notice The operation will be in-place, i.e., the array provided as the\\n/// argument will be modified.\\ncontract Sort {\\n uint256 internal constant MAX_SORT_LENGTH = 9;\\n\\n /// @notice Sorts the array\\n /// @param array Array to be sorted\\n function sort(int256[] memory array) internal pure {\\n uint256 arrayLength = array.length;\\n require(arrayLength <= MAX_SORT_LENGTH, \\\"Array too long to sort\\\");\\n // Do a binary search\\n if (arrayLength < 6) {\\n // Possible lengths: 1, 2, 3, 4, 5\\n if (arrayLength < 4) {\\n // Possible lengths: 1, 2, 3\\n if (arrayLength == 3) {\\n // Length: 3\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 0, 1);\\n } else if (arrayLength == 2) {\\n // Length: 2\\n swapIfFirstIsLarger(array, 0, 1);\\n }\\n // Do nothing for Length: 1\\n } else {\\n // Possible lengths: 4, 5\\n if (arrayLength == 5) {\\n // Length: 5\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 1, 2);\\n } else {\\n // Length: 4\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 1, 2);\\n }\\n }\\n } else {\\n // Possible lengths: 6, 7, 8, 9\\n if (arrayLength < 8) {\\n // Possible lengths: 6, 7\\n if (arrayLength == 7) {\\n // Length: 7\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 4, 6);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 2, 6);\\n swapIfFirstIsLarger(array, 1, 5);\\n swapIfFirstIsLarger(array, 0, 4);\\n swapIfFirstIsLarger(array, 2, 5);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n } else {\\n // Length: 6\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 2, 3);\\n }\\n } else {\\n // Possible lengths: 8, 9\\n if (arrayLength == 9) {\\n // Length: 9\\n swapIfFirstIsLarger(array, 1, 8);\\n swapIfFirstIsLarger(array, 2, 7);\\n swapIfFirstIsLarger(array, 3, 6);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 1, 4);\\n swapIfFirstIsLarger(array, 5, 8);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 2, 6);\\n swapIfFirstIsLarger(array, 7, 8);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 5, 7);\\n swapIfFirstIsLarger(array, 4, 6);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 7, 8);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n } else {\\n // Length: 8\\n swapIfFirstIsLarger(array, 0, 7);\\n swapIfFirstIsLarger(array, 1, 6);\\n swapIfFirstIsLarger(array, 2, 5);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 4, 7);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 3, 4);\\n }\\n }\\n }\\n }\\n\\n /// @notice Swaps two elements of an array if the first element is greater\\n /// than the second\\n /// @param array Array whose elements are to be swapped\\n /// @param ind1 Index of the first element\\n /// @param ind2 Index of the second element\\n function swapIfFirstIsLarger(\\n int256[] memory array,\\n uint256 ind1,\\n uint256 ind2\\n ) private pure {\\n if (array[ind1] > array[ind2]) {\\n (array[ind1], array[ind2]) = (array[ind2], array[ind1]);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x81e3790f7964b0169e60022f00f988a136e37a043053d8b07c794cc1c9b6c510\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDapiServer.sol\\\";\\nimport \\\"./IBeaconUpdatesWithSignedData.sol\\\";\\n\\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n}\\n\",\"keccak256\":\"0xea2c05eaf2a19c93a9c9b08243fcabd8d7fcf0e4d422f7c687aef693126c1809\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n}\\n\",\"keccak256\":\"0xe2b2530081508baf1323d4c145a688ffd548cf318a8cb67c9ccb4abe1ac81c6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IDapiServer is\\n IAccessControlRegistryAdminnedWithManager,\\n IDataFeedServer\\n{\\n event SetDapiName(\\n bytes32 indexed dataFeedId,\\n bytes32 indexed dapiName,\\n address sender\\n );\\n\\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\\n\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view returns (bytes32);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function dapiNameSetterRole() external view returns (bytes32);\\n\\n function dapiNameHashToDataFeedId(\\n bytes32 dapiNameHash\\n ) external view returns (bytes32 dataFeedId);\\n}\\n\",\"keccak256\":\"0x1cf1d7637e2ee1b4f5b99345730183447db78ceb8ce2117cf145d4d375194e71\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IDataFeedServer is IExtendedSelfMulticall {\\n event UpdatedBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedBeaconSetWithBeacons(\\n bytes32 indexed beaconSetId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) external returns (bytes32 beaconSetId);\\n}\\n\",\"keccak256\":\"0x208f751f71b16d454cafd9188095178fdc776ee0376a85362f6022e7a4f010a3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDataFeedServer.sol\\\";\\nimport \\\"./IDapiServer.sol\\\";\\n\\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\\n\",\"keccak256\":\"0xf4082c33979785131358a217a8c5cf498a53c04318868eb1cb68e934c33226e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IOevDataFeedServer is IDataFeedServer {\\n event UpdatedOevProxyBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedOevProxyBeaconSetWithSignedData(\\n bytes32 indexed beaconSetId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event Withdrew(\\n address indexed oevProxy,\\n address oevBeneficiary,\\n uint256 amount\\n );\\n\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable;\\n\\n function withdraw(address oevProxy) external;\\n\\n function oevProxyToBalance(\\n address oevProxy\\n ) external view returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x2d162c576bfe5554767bb48758314c3e6f2c509f73203f0e166d1ac5168a1218\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOevProxy {\\n function oevBeneficiary() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcd9962a465c96e85638eb40775da008f9c86a0ea0c50c7c5fcbb11c55f48fc22\",\"license\":\"MIT\"},\"contracts/utils/ExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"./SelfMulticall.sol\\\";\\nimport \\\"./interfaces/IExtendedSelfMulticall.sol\\\";\\n\\n/// @title Contract that extends SelfMulticall to fetch some of the global\\n/// variables\\n/// @notice Available global variables are limited to the ones that Airnode\\n/// tends to need\\ncontract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {\\n /// @notice Returns the chain ID\\n /// @return Chain ID\\n function getChainId() external view override returns (uint256) {\\n return block.chainid;\\n }\\n\\n /// @notice Returns the account balance\\n /// @param account Account address\\n /// @return Account balance\\n function getBalance(\\n address account\\n ) external view override returns (uint256) {\\n return account.balance;\\n }\\n\\n /// @notice Returns if the account contains bytecode\\n /// @dev An account not containing any bytecode does not indicate that it\\n /// is an EOA or it will not contain any bytecode in the future.\\n /// Contract construction and `SELFDESTRUCT` updates the bytecode at the\\n /// end of the transaction.\\n /// @return If the account contains bytecode\\n function containsBytecode(\\n address account\\n ) external view override returns (bool) {\\n return account.code.length > 0;\\n }\\n\\n /// @notice Returns the current block number\\n /// @return Current block number\\n function getBlockNumber() external view override returns (uint256) {\\n return block.number;\\n }\\n\\n /// @notice Returns the current block timestamp\\n /// @return Current block timestamp\\n function getBlockTimestamp() external view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /// @notice Returns the current block basefee\\n /// @return Current block basefee\\n function getBlockBasefee() external view override returns (uint256) {\\n return block.basefee;\\n }\\n}\\n\",\"keccak256\":\"0xada4020386f51e076953a110accf21efc53b82858bb88fc6725591556d86574b\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISelfMulticall.sol\\\";\\n\\ninterface IExtendedSelfMulticall is ISelfMulticall {\\n function getChainId() external view returns (uint256);\\n\\n function getBalance(address account) external view returns (uint256);\\n\\n function containsBytecode(address account) external view returns (bool);\\n\\n function getBlockNumber() external view returns (uint256);\\n\\n function getBlockTimestamp() external view returns (uint256);\\n\\n function getBlockBasefee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xaefe61a623c920d3e39c4779535e280378b44202d11c29a2c96f46f2fe5f420d\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xda898fa084aa1ddfdb346e6a40459e00a59d87071cce7c315a46d648dd71d0ba\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220693313c61a998d79d0e9b250367bd14ac439bd3d1d1f36bf50317fc99059456d64736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220693313c61a998d79d0e9b250367bd14ac439bd3d1d1f36bf50317fc99059456d64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "_accessControlRegistry": "AccessControlRegistry contract address", + "_adminRoleDescription": "Admin role description", + "_manager": "Manager address" + } + }, + "containsBytecode(address)": { + "details": "An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.", + "returns": { + "_0": "If the account contains bytecode" + } + }, + "dapiNameToDataFeedId(bytes32)": { + "params": { + "dapiName": "dAPI name" + }, + "returns": { + "_0": "Data feed ID" + } + }, + "getBalance(address)": { + "params": { + "account": "Account address" + }, + "returns": { + "_0": "Account balance" + } + }, + "getBlockBasefee()": { + "returns": { + "_0": "Current block basefee" + } + }, + "getBlockNumber()": { + "returns": { + "_0": "Current block number" + } + }, + "getBlockTimestamp()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "getChainId()": { + "returns": { + "_0": "Chain ID" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "readDataFeedWithDapiNameHash(bytes32)": { + "params": { + "dapiNameHash": "dAPI name hash" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithDapiNameHashAsOevProxy(bytes32)": { + "params": { + "dapiNameHash": "dAPI name hash" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithId(bytes32)": { + "params": { + "dataFeedId": "Data feed ID" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithIdAsOevProxy(bytes32)": { + "params": { + "dataFeedId": "Data feed ID" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "setDapiName(bytes32,bytes32)": { + "details": "While a data feed ID refers to a specific Beacon or Beacon set, dAPI names provide a more abstract interface for convenience. This means a dAPI name that was pointing to a Beacon can be pointed to a Beacon set, then another Beacon set, etc.", + "params": { + "dapiName": "Human-readable dAPI name", + "dataFeedId": "Data feed ID the dAPI name will point to" + } + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "details": "As an oddity, this function still works if some of the IDs in `beaconIds` belong to Beacon sets rather than Beacons. This can be used to implement hierarchical Beacon sets.", + "params": { + "beaconIds": "Beacon IDs" + }, + "returns": { + "beaconSetId": "Beacon set ID" + } + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "details": "The signed data here is intentionally very general for practical reasons. It is less demanding on the signer to have data signed once and use that everywhere.", + "params": { + "airnode": "Airnode address", + "data": "Update data (an `int256` encoded in contract ABI)", + "signature": "Template ID, timestamp and the update data signed by the Airnode", + "templateId": "Template ID", + "timestamp": "Signature timestamp" + }, + "returns": { + "beaconId": "Updated Beacon ID" + } + }, + "updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])": { + "details": "For when the data feed being updated is a Beacon set, an absolute majority of the Airnodes that power the respective Beacons must sign the aggregated value and timestamp. While doing so, the Airnodes should refer to data signed to update an absolute majority of the respective Beacons. The Airnodes should require the data to be fresh enough (e.g., at most 2 minutes-old), and tightly distributed around the resulting aggregation (e.g., within 1% deviation), and reject to provide an OEV proxy data feed update signature if these are not satisfied.", + "params": { + "data": "Update data (an `int256` encoded in contract ABI)", + "dataFeedId": "Data feed ID", + "oevProxy": "OEV proxy that reads the data feed", + "packedOevUpdateSignatures": "Packed OEV update signatures, which include the Airnode address, template ID and these signed with the OEV update hash", + "timestamp": "Signature timestamp", + "updateId": "Update ID" + } + }, + "withdraw(address)": { + "details": "This does not require the caller to be the beneficiary because we expect that in most cases, the OEV beneficiary will be a contract that will not be able to make arbitrary calls. Our choice can be worked around by implementing a beneficiary proxy.", + "params": { + "oevProxy": "OEV proxy" + } + } + }, + "title": "First version of the contract that API3 uses to serve data feeds", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "DAPI_NAME_SETTER_ROLE_DESCRIPTION()": { + "notice": "dAPI name setter role description" + }, + "accessControlRegistry()": { + "notice": "AccessControlRegistry contract address" + }, + "adminRole()": { + "notice": "Admin role" + }, + "adminRoleDescription()": { + "notice": "Admin role description" + }, + "containsBytecode(address)": { + "notice": "Returns if the account contains bytecode" + }, + "dapiNameHashToDataFeedId(bytes32)": { + "notice": "dAPI name hash mapped to the data feed ID" + }, + "dapiNameSetterRole()": { + "notice": "dAPI name setter role" + }, + "dapiNameToDataFeedId(bytes32)": { + "notice": "Returns the data feed ID the dAPI name is set to" + }, + "getBalance(address)": { + "notice": "Returns the account balance" + }, + "getBlockBasefee()": { + "notice": "Returns the current block basefee" + }, + "getBlockNumber()": { + "notice": "Returns the current block number" + }, + "getBlockTimestamp()": { + "notice": "Returns the current block timestamp" + }, + "getChainId()": { + "notice": "Returns the chain ID" + }, + "manager()": { + "notice": "Address of the manager that manages the related AccessControlRegistry roles" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "oevProxyToBalance(address)": { + "notice": "Accumulated OEV auction proceeds for the specific proxy" + }, + "readDataFeedWithDapiNameHash(bytes32)": { + "notice": "Reads the data feed with dAPI name hash" + }, + "readDataFeedWithDapiNameHashAsOevProxy(bytes32)": { + "notice": "Reads the data feed as the OEV proxy with dAPI name hash" + }, + "readDataFeedWithId(bytes32)": { + "notice": "Reads the data feed with ID" + }, + "readDataFeedWithIdAsOevProxy(bytes32)": { + "notice": "Reads the data feed as the OEV proxy with ID" + }, + "setDapiName(bytes32,bytes32)": { + "notice": "Sets the data feed ID the dAPI name points to" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "notice": "Updates the Beacon set using the current values of its Beacons" + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "notice": "Updates a Beacon using data signed by the Airnode" + }, + "updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])": { + "notice": "Updates a data feed that the OEV proxy reads using the aggregation signed by the absolute majority of the respective Airnodes for the specific bid" + }, + "withdraw(address)": { + "notice": "Withdraws the balance of the OEV proxy to the respective beneficiary account" + } + }, + "notice": "Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets, dAPIs, with optional OEV support for all of these. The base Beacons are only updateable using signed data, and the Beacon sets are updateable based on the Beacons, optionally using PSP. OEV proxy Beacons and Beacon sets are updateable using OEV-signed data. Api3ServerV1 does not support Beacons to be updated using RRP or PSP.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 176, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "adminRoleDescription", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 4593, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "_dataFeeds", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_struct(DataFeed)4587_storage)" + }, + { + "astId": 6681, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "_oevProxyToIdToDataFeed", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4587_storage))" + }, + { + "astId": 6687, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "oevProxyToBalance", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 4415, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "dapiNameHashToDataFeedId", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_bytes32)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_int224": { + "encoding": "inplace", + "label": "int224", + "numberOfBytes": "28" + }, + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)4587_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_struct(DataFeed)4587_storage)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bytes32)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_bytes32,t_struct(DataFeed)4587_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", + "numberOfBytes": "32", + "value": "t_struct(DataFeed)4587_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(DataFeed)4587_storage": { + "encoding": "inplace", + "label": "struct DataFeedServer.DataFeed", + "members": [ + { + "astId": 4584, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "value", + "offset": 0, + "slot": "0", + "type": "t_int224" + }, + { + "astId": 4586, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "timestamp", + "offset": 28, + "slot": "0", + "type": "t_uint32" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} diff --git a/deployments/blast-sepolia-testnet/OwnableCallForwarder.json b/deployments/blast-sepolia-testnet/OwnableCallForwarder.json new file mode 100644 index 00000000..1c2b072e --- /dev/null +++ b/deployments/blast-sepolia-testnet/OwnableCallForwarder.json @@ -0,0 +1,202 @@ +{ + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwardTarget", + "type": "address" + }, + { + "internalType": "bytes", + "name": "forwardedCalldata", + "type": "bytes" + } + ], + "name": "forwardCall", + "outputs": [ + { + "internalType": "bytes", + "name": "returnedData", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x4665eeacb2c4453d42ce0f78e52bc3dab2f82d001c5960eaef2650414b9a2490", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 2, + "gasUsed": "410830", + "logsBloom": "0x00000080000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000040000000000020000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000020000000000000000000010000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000000000000000000000000000000", + "blockHash": "0x2f737c1662bffe23e66756a4db9809c3a3137f124a8bb14dce5a67e80e15bbb6", + "transactionHash": "0x4665eeacb2c4453d42ce0f78e52bc3dab2f82d001c5960eaef2650414b9a2490", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 1693140, + "transactionHash": "0x4665eeacb2c4453d42ce0f78e52bc3dab2f82d001c5960eaef2650414b9a2490", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x2f737c1662bffe23e66756a4db9809c3a3137f124a8bb14dce5a67e80e15bbb6" + }, + { + "transactionIndex": 2, + "blockNumber": 1693140, + "transactionHash": "0x4665eeacb2c4453d42ce0f78e52bc3dab2f82d001c5960eaef2650414b9a2490", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", + "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x2f737c1662bffe23e66756a4db9809c3a3137f124a8bb14dce5a67e80e15bbb6" + } + ], + "blockNumber": 1693140, + "cumulativeGasUsed": "528289", + "status": 1, + "byzantium": true + }, + "args": ["0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1"], + "numDeployments": 1, + "solcInputHash": "9a9784f0166e92dcfa54df2d2c909051", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwardTarget\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"forwardedCalldata\",\"type\":\"bytes\"}],\"name\":\"forwardCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returnedData\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"Owner address\"}},\"forwardCall(address,bytes)\":{\"params\":{\"forwardTarget\":\"Target address that the calldata will be forwarded to\",\"forwardedCalldata\":\"Calldata to be forwarded to the target address\"},\"returns\":{\"returnedData\":\"Data returned by the forwarded call\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Contract that forwards the calls that its owner sends\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"forwardCall(address,bytes)\":{\"notice\":\"Forwards the calldata and the value to the target address if the sender is the owner and returns the data\"}},\"notice\":\"AccessControlRegistry users that want their access control tables to be transferrable (e.g., a DAO) will use this forwarder instead of interacting with it directly. There are cases where this transferrability is not desired, e.g., if the user is an Airnode and is immutably associated with a single address, in which case the manager will interact with AccessControlRegistry directly.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/OwnableCallForwarder.sol\":\"OwnableCallForwarder\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/access/OwnableCallForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/access/Ownable.sol\\\";\\nimport \\\"../vendor/@openzeppelin/contracts@4.8.2/utils/Address.sol\\\";\\nimport \\\"./interfaces/IOwnableCallForwarder.sol\\\";\\n\\n/// @title Contract that forwards the calls that its owner sends\\n/// @notice AccessControlRegistry users that want their access control tables\\n/// to be transferrable (e.g., a DAO) will use this forwarder instead of\\n/// interacting with it directly. There are cases where this transferrability\\n/// is not desired, e.g., if the user is an Airnode and is immutably associated\\n/// with a single address, in which case the manager will interact with\\n/// AccessControlRegistry directly.\\ncontract OwnableCallForwarder is Ownable, IOwnableCallForwarder {\\n /// @param _owner Owner address\\n constructor(address _owner) {\\n transferOwnership(_owner);\\n }\\n\\n /// @notice Forwards the calldata and the value to the target address if\\n /// the sender is the owner and returns the data\\n /// @param forwardTarget Target address that the calldata will be forwarded\\n /// to\\n /// @param forwardedCalldata Calldata to be forwarded to the target address\\n /// @return returnedData Data returned by the forwarded call\\n function forwardCall(\\n address forwardTarget,\\n bytes calldata forwardedCalldata\\n ) external payable override onlyOwner returns (bytes memory returnedData) {\\n returnedData = Address.functionCallWithValue(\\n forwardTarget,\\n forwardedCalldata,\\n msg.value\\n );\\n }\\n}\\n\",\"keccak256\":\"0x8ae5a7cd680c844985a7f74550e5144ac5250e25d30bbee35b68d23d77c02e31\",\"license\":\"MIT\"},\"contracts/access/interfaces/IOwnableCallForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOwnableCallForwarder {\\n function forwardCall(\\n address forwardTarget,\\n bytes calldata forwardedCalldata\\n ) external payable returns (bytes memory returnedData);\\n}\\n\",\"keccak256\":\"0x13e5e17e12d5d907f72ac1f52d88592903755edafe1162b7cb68700c93d1ba1c\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/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\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/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\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/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\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161079038038061079083398101604081905261002f91610171565b61003833610047565b61004181610097565b506101a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61009f610115565b6001600160a01b0381166101095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61011281610047565b50565b6000546001600160a01b0316331461016f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610100565b565b60006020828403121561018357600080fd5b81516001600160a01b038116811461019a57600080fd5b9392505050565b6105e0806101b06000396000f3fe60806040526004361061003f5760003560e01c806322bee49414610044578063715018a61461006d5780638da5cb5b14610084578063f2fde38b146100ac575b600080fd5b61005761005236600461045d565b6100cc565b6040516100649190610530565b60405180910390f35b34801561007957600080fd5b50610082610120565b005b34801561009057600080fd5b506000546040516001600160a01b039091168152602001610064565b3480156100b857600080fd5b506100826100c736600461054a565b610134565b60606100d66101c9565b6101188484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250349250610223915050565b949350505050565b6101286101c9565b6101326000610249565b565b61013c6101c9565b6001600160a01b0381166101bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6101c681610249565b50565b6000546001600160a01b031633146101325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101b4565b6060610118848484604051806060016040528060298152602001610582602991396102b1565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156103295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101b4565b600080866001600160a01b031685876040516103459190610565565b60006040518083038185875af1925050503d8060008114610382576040519150601f19603f3d011682016040523d82523d6000602084013e610387565b606091505b5091509150610398878383876103a3565b979650505050505050565b6060831561041257825160000361040b576001600160a01b0385163b61040b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101b4565b5081610118565b61011883838151156104275781518083602001fd5b8060405162461bcd60e51b81526004016101b49190610530565b80356001600160a01b038116811461045857600080fd5b919050565b60008060006040848603121561047257600080fd5b61047b84610441565b9250602084013567ffffffffffffffff8082111561049857600080fd5b818601915086601f8301126104ac57600080fd5b8135818111156104bb57600080fd5b8760208285010111156104cd57600080fd5b6020830194508093505050509250925092565b60005b838110156104fb5781810151838201526020016104e3565b50506000910152565b6000815180845261051c8160208601602086016104e0565b601f01601f19169290920160200192915050565b6020815260006105436020830184610504565b9392505050565b60006020828403121561055c57600080fd5b61054382610441565b600082516105778184602087016104e0565b919091019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212209bc00d30ca9753335445fb76197730f010383979aa0fd4b393e2e8826680071064736f6c63430008110033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806322bee49414610044578063715018a61461006d5780638da5cb5b14610084578063f2fde38b146100ac575b600080fd5b61005761005236600461045d565b6100cc565b6040516100649190610530565b60405180910390f35b34801561007957600080fd5b50610082610120565b005b34801561009057600080fd5b506000546040516001600160a01b039091168152602001610064565b3480156100b857600080fd5b506100826100c736600461054a565b610134565b60606100d66101c9565b6101188484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250349250610223915050565b949350505050565b6101286101c9565b6101326000610249565b565b61013c6101c9565b6001600160a01b0381166101bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6101c681610249565b50565b6000546001600160a01b031633146101325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101b4565b6060610118848484604051806060016040528060298152602001610582602991396102b1565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156103295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101b4565b600080866001600160a01b031685876040516103459190610565565b60006040518083038185875af1925050503d8060008114610382576040519150601f19603f3d011682016040523d82523d6000602084013e610387565b606091505b5091509150610398878383876103a3565b979650505050505050565b6060831561041257825160000361040b576001600160a01b0385163b61040b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101b4565b5081610118565b61011883838151156104275781518083602001fd5b8060405162461bcd60e51b81526004016101b49190610530565b80356001600160a01b038116811461045857600080fd5b919050565b60008060006040848603121561047257600080fd5b61047b84610441565b9250602084013567ffffffffffffffff8082111561049857600080fd5b818601915086601f8301126104ac57600080fd5b8135818111156104bb57600080fd5b8760208285010111156104cd57600080fd5b6020830194508093505050509250925092565b60005b838110156104fb5781810151838201526020016104e3565b50506000910152565b6000815180845261051c8160208601602086016104e0565b601f01601f19169290920160200192915050565b6020815260006105436020830184610504565b9392505050565b60006020828403121561055c57600080fd5b61054382610441565b600082516105778184602087016104e0565b919091019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212209bc00d30ca9753335445fb76197730f010383979aa0fd4b393e2e8826680071064736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "_owner": "Owner address" + } + }, + "forwardCall(address,bytes)": { + "params": { + "forwardTarget": "Target address that the calldata will be forwarded to", + "forwardedCalldata": "Calldata to be forwarded to the target address" + }, + "returns": { + "returnedData": "Data returned by the forwarded call" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Contract that forwards the calls that its owner sends", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "forwardCall(address,bytes)": { + "notice": "Forwards the calldata and the value to the target address if the sender is the owner and returns the data" + } + }, + "notice": "AccessControlRegistry users that want their access control tables to be transferrable (e.g., a DAO) will use this forwarder instead of interacting with it directly. There are cases where this transferrability is not desired, e.g., if the user is an Airnode and is immutably associated with a single address, in which case the manager will interact with AccessControlRegistry directly.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 11479, + "contract": "contracts/access/OwnableCallForwarder.sol:OwnableCallForwarder", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/blast-sepolia-testnet/ProxyFactory.json b/deployments/blast-sepolia-testnet/ProxyFactory.json new file mode 100644 index 00000000..bc209e8f --- /dev/null +++ b/deployments/blast-sepolia-testnet/ProxyFactory.json @@ -0,0 +1,501 @@ +{ + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_api3ServerV1", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDapiProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDapiProxyWithOev", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDataFeedProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDataFeedProxyWithOev", + "type": "event" + }, + { + "inputs": [], + "name": "api3ServerV1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDapiProxyAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDapiProxyWithOevAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDataFeedProxyAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDataFeedProxyWithOevAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxy", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxyWithOev", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDataFeedProxy", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDataFeedProxyWithOev", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x0c94b2d1c383984070dccfc7eb50482e450d2b2b1da42e4b086c5e9ecc742881", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 4, + "gasUsed": "1473171", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb488c92b2a2a87cf771498dd15315a61f3a0978ff76da4fafc663e7b259330a8", + "transactionHash": "0x0c94b2d1c383984070dccfc7eb50482e450d2b2b1da42e4b086c5e9ecc742881", + "logs": [], + "blockNumber": 1693151, + "cumulativeGasUsed": "2619940", + "status": 1, + "byzantium": true + }, + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], + "numDeployments": 1, + "solcInputHash": "9a9784f0166e92dcfa54df2d2c909051", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_api3ServerV1\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDapiProxy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDapiProxyWithOev\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDataFeedProxy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDataFeedProxyWithOev\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"api3ServerV1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDapiProxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDapiProxyWithOevAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDataFeedProxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDataFeedProxyWithOevAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxyWithOev\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDataFeedProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDataFeedProxyWithOev\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The proxies are deployed normally and not cloned to minimize the gas cost overhead while using them to read data feed values\",\"kind\":\"dev\",\"methods\":{\"computeDapiProxyAddress(bytes32,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDapiProxyWithOevAddress(bytes32,address,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDataFeedProxyAddress(bytes32,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDataFeedProxyWithOevAddress(bytes32,address,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"constructor\":{\"params\":{\"_api3ServerV1\":\"Api3ServerV1 address\"}},\"deployDapiProxy(bytes32,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDataFeedProxy(bytes32,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDataFeedProxyWithOev(bytes32,address,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}}},\"title\":\"Contract factory that deterministically deploys proxies that read data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV support\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"api3ServerV1()\":{\"notice\":\"Api3ServerV1 address\"},\"computeDapiProxyAddress(bytes32,bytes)\":{\"notice\":\"Computes the address of the dAPI proxy\"},\"computeDapiProxyWithOevAddress(bytes32,address,bytes)\":{\"notice\":\"Computes the address of the dAPI proxy with OEV support\"},\"computeDataFeedProxyAddress(bytes32,bytes)\":{\"notice\":\"Computes the address of the data feed proxy\"},\"computeDataFeedProxyWithOevAddress(bytes32,address,bytes)\":{\"notice\":\"Computes the address of the data feed proxy with OEV support\"},\"deployDapiProxy(bytes32,bytes)\":{\"notice\":\"Deterministically deploys a dAPI proxy\"},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"notice\":\"Deterministically deploys a dAPI proxy with OEV support\"},\"deployDataFeedProxy(bytes32,bytes)\":{\"notice\":\"Deterministically deploys a data feed proxy\"},\"deployDataFeedProxyWithOev(bytes32,address,bytes)\":{\"notice\":\"Deterministically deploys a data feed proxy with OEV support\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/api3-server-v1/proxies/ProxyFactory.sol\":\"ProxyFactory\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/access/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDapiServer.sol\\\";\\nimport \\\"./IBeaconUpdatesWithSignedData.sol\\\";\\n\\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n}\\n\",\"keccak256\":\"0xea2c05eaf2a19c93a9c9b08243fcabd8d7fcf0e4d422f7c687aef693126c1809\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n}\\n\",\"keccak256\":\"0xe2b2530081508baf1323d4c145a688ffd548cf318a8cb67c9ccb4abe1ac81c6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IDapiServer is\\n IAccessControlRegistryAdminnedWithManager,\\n IDataFeedServer\\n{\\n event SetDapiName(\\n bytes32 indexed dataFeedId,\\n bytes32 indexed dapiName,\\n address sender\\n );\\n\\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\\n\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view returns (bytes32);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function dapiNameSetterRole() external view returns (bytes32);\\n\\n function dapiNameHashToDataFeedId(\\n bytes32 dapiNameHash\\n ) external view returns (bytes32 dataFeedId);\\n}\\n\",\"keccak256\":\"0x1cf1d7637e2ee1b4f5b99345730183447db78ceb8ce2117cf145d4d375194e71\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IDataFeedServer is IExtendedSelfMulticall {\\n event UpdatedBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedBeaconSetWithBeacons(\\n bytes32 indexed beaconSetId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) external returns (bytes32 beaconSetId);\\n}\\n\",\"keccak256\":\"0x208f751f71b16d454cafd9188095178fdc776ee0376a85362f6022e7a4f010a3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDataFeedServer.sol\\\";\\nimport \\\"./IDapiServer.sol\\\";\\n\\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\\n\",\"keccak256\":\"0xf4082c33979785131358a217a8c5cf498a53c04318868eb1cb68e934c33226e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IOevDataFeedServer is IDataFeedServer {\\n event UpdatedOevProxyBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedOevProxyBeaconSetWithSignedData(\\n bytes32 indexed beaconSetId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event Withdrew(\\n address indexed oevProxy,\\n address oevBeneficiary,\\n uint256 amount\\n );\\n\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable;\\n\\n function withdraw(address oevProxy) external;\\n\\n function oevProxyToBalance(\\n address oevProxy\\n ) external view returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x2d162c576bfe5554767bb48758314c3e6f2c509f73203f0e166d1ac5168a1218\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DapiProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/IDapiProxy.sol\\\";\\nimport \\\"../interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific dAPI of\\n/// a specific Api3ServerV1 contract\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev The proxy contracts are generalized to support most types of numerical\\n/// data feeds. This means that the user of this proxy is expected to validate\\n/// the read values according to the specific use-case. For example, `value` is\\n/// a signed integer, yet it being negative may not make sense in the case that\\n/// the data feed represents the spot price of an asset. In that case, the user\\n/// is responsible with ensuring that `value` is not negative.\\n/// In the case that the data feed is from a single source, `timestamp` is the\\n/// system time of the Airnode when it signed the data. In the case that the\\n/// data feed is from multiple sources, `timestamp` is the median of system\\n/// times of the Airnodes when they signed the respective data. There are two\\n/// points to consider while using `timestamp` in your contract logic: (1) It\\n/// is based on the system time of the Airnodes, and not the block timestamp.\\n/// This may be relevant when either of them drifts. (2) `timestamp` is an\\n/// off-chain value that is being reported, similar to `value`. Both should\\n/// only be trusted as much as the Airnode(s) that report them.\\ncontract DapiProxy is IDapiProxy {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n /// @notice Hash of the dAPI name\\n bytes32 public immutable override dapiNameHash;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dapiNameHash Hash of the dAPI name\\n constructor(address _api3ServerV1, bytes32 _dapiNameHash) {\\n api3ServerV1 = _api3ServerV1;\\n dapiNameHash = _dapiNameHash;\\n }\\n\\n /// @notice Reads the dAPI that this proxy maps to\\n /// @return value dAPI value\\n /// @return timestamp dAPI timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithDapiNameHash(dapiNameHash);\\n }\\n}\\n\",\"keccak256\":\"0x7bda11348ffff6be0621803c2ef1e146b9abd55e9b6f35a71392b2ecbf18f8ea\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DapiProxyWithOev.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DapiProxy.sol\\\";\\nimport \\\"./interfaces/IOevProxy.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific dAPI of\\n/// a specific Api3ServerV1 contract and inform Api3ServerV1 about the\\n/// beneficiary of the respective OEV proceeds\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DapiProxyWithOev is DapiProxy, IOevProxy {\\n /// @notice OEV beneficiary address\\n address public immutable override oevBeneficiary;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dapiNameHash Hash of the dAPI name\\n /// @param _oevBeneficiary OEV beneficiary\\n constructor(\\n address _api3ServerV1,\\n bytes32 _dapiNameHash,\\n address _oevBeneficiary\\n ) DapiProxy(_api3ServerV1, _dapiNameHash) {\\n oevBeneficiary = _oevBeneficiary;\\n }\\n\\n /// @notice Reads the dAPI that this proxy maps to\\n /// @return value dAPI value\\n /// @return timestamp dAPI timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\\n }\\n}\\n\",\"keccak256\":\"0x1ebe7b44c0e49d9afc942dc1beea2a0c42ad79bb514086ea9e74d027ec7237c9\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DataFeedProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/IDataFeedProxy.sol\\\";\\nimport \\\"../interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific data\\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DataFeedProxy is IDataFeedProxy {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n /// @notice Data feed ID\\n bytes32 public immutable override dataFeedId;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\\n constructor(address _api3ServerV1, bytes32 _dataFeedId) {\\n api3ServerV1 = _api3ServerV1;\\n dataFeedId = _dataFeedId;\\n }\\n\\n /// @notice Reads the data feed that this proxy maps to\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1).readDataFeedWithId(\\n dataFeedId\\n );\\n }\\n}\\n\",\"keccak256\":\"0x955b09a7777f4c80ebcff66a7e685459b0308a94eb6faf78757274e9dff643d4\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DataFeedProxyWithOev.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DataFeedProxy.sol\\\";\\nimport \\\"./interfaces/IOevProxy.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific data\\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract and inform\\n/// Api3ServerV1 about the beneficiary of the respective OEV proceeds\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DataFeedProxyWithOev is DataFeedProxy, IOevProxy {\\n /// @notice OEV beneficiary address\\n address public immutable override oevBeneficiary;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\\n /// @param _oevBeneficiary OEV beneficiary\\n constructor(\\n address _api3ServerV1,\\n bytes32 _dataFeedId,\\n address _oevBeneficiary\\n ) DataFeedProxy(_api3ServerV1, _dataFeedId) {\\n oevBeneficiary = _oevBeneficiary;\\n }\\n\\n /// @notice Reads the data feed that this proxy maps to\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithIdAsOevProxy(dataFeedId);\\n }\\n}\\n\",\"keccak256\":\"0xad9ccf4ed36a49e13da6a84bf617b22888d0c5b3db737c139609ee322aa4bff8\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/ProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DataFeedProxy.sol\\\";\\nimport \\\"./DapiProxy.sol\\\";\\nimport \\\"./DataFeedProxyWithOev.sol\\\";\\nimport \\\"./DapiProxyWithOev.sol\\\";\\nimport \\\"./interfaces/IProxyFactory.sol\\\";\\nimport \\\"../../vendor/@openzeppelin/contracts@4.8.2/utils/Create2.sol\\\";\\n\\n/// @title Contract factory that deterministically deploys proxies that read\\n/// data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV\\n/// support\\n/// @dev The proxies are deployed normally and not cloned to minimize the gas\\n/// cost overhead while using them to read data feed values\\ncontract ProxyFactory is IProxyFactory {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n constructor(address _api3ServerV1) {\\n require(_api3ServerV1 != address(0), \\\"Api3ServerV1 address zero\\\");\\n api3ServerV1 = _api3ServerV1;\\n }\\n\\n /// @notice Deterministically deploys a data feed proxy\\n /// @param dataFeedId Data feed ID\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDataFeedProxy(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n proxyAddress = address(\\n new DataFeedProxy{salt: keccak256(metadata)}(\\n api3ServerV1,\\n dataFeedId\\n )\\n );\\n emit DeployedDataFeedProxy(proxyAddress, dataFeedId, metadata);\\n }\\n\\n /// @notice Deterministically deploys a dAPI proxy\\n /// @param dapiName dAPI name\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n proxyAddress = address(\\n new DapiProxy{salt: keccak256(metadata)}(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName))\\n )\\n );\\n emit DeployedDapiProxy(proxyAddress, dapiName, metadata);\\n }\\n\\n /// @notice Deterministically deploys a data feed proxy with OEV support\\n /// @param dataFeedId Data feed ID\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDataFeedProxyWithOev(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = address(\\n new DataFeedProxyWithOev{salt: keccak256(metadata)}(\\n api3ServerV1,\\n dataFeedId,\\n oevBeneficiary\\n )\\n );\\n emit DeployedDataFeedProxyWithOev(\\n proxyAddress,\\n dataFeedId,\\n oevBeneficiary,\\n metadata\\n );\\n }\\n\\n /// @notice Deterministically deploys a dAPI proxy with OEV support\\n /// @param dapiName dAPI name\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = address(\\n new DapiProxyWithOev{salt: keccak256(metadata)}(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName)),\\n oevBeneficiary\\n )\\n );\\n emit DeployedDapiProxyWithOev(\\n proxyAddress,\\n dapiName,\\n oevBeneficiary,\\n metadata\\n );\\n }\\n\\n /// @notice Computes the address of the data feed proxy\\n /// @param dataFeedId Data feed ID\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDataFeedProxyAddress(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DataFeedProxy).creationCode,\\n abi.encode(api3ServerV1, dataFeedId)\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the dAPI proxy\\n /// @param dapiName dAPI name\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDapiProxyAddress(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DapiProxy).creationCode,\\n abi.encode(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName))\\n )\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the data feed proxy with OEV support\\n /// @param dataFeedId Data feed ID\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDataFeedProxyWithOevAddress(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DataFeedProxyWithOev).creationCode,\\n abi.encode(api3ServerV1, dataFeedId, oevBeneficiary)\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the dAPI proxy with OEV support\\n /// @param dapiName dAPI name\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDapiProxyWithOevAddress(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DapiProxyWithOev).creationCode,\\n abi.encode(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName)),\\n oevBeneficiary\\n )\\n )\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0xe185b6cd0e887d2c8b9eb89e06ab9fa76e3d7ce2effbfbb701f94a22f1fcd152\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IDapiProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IProxy.sol\\\";\\n\\ninterface IDapiProxy is IProxy {\\n function dapiNameHash() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x7fee704659b2fd4629ce105b686284bb922f73d2261b04ad927f8e4b54479409\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IDataFeedProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IProxy.sol\\\";\\n\\ninterface IDataFeedProxy is IProxy {\\n function dataFeedId() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x114b4d530c3aa4e9359d7d4596170068b294d65ead405dc590b120e991d7b587\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOevProxy {\\n function oevBeneficiary() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcd9962a465c96e85638eb40775da008f9c86a0ea0c50c7c5fcbb11c55f48fc22\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @dev See DapiProxy.sol for comments about usage\\ninterface IProxy {\\n function read() external view returns (int224 value, uint32 timestamp);\\n\\n function api3ServerV1() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3ad69ef6ff3de4056ec43eb8b47465f3d896f88e95cfffb909a6d057b91db17b\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IProxyFactory {\\n event DeployedDataFeedProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n bytes metadata\\n );\\n\\n event DeployedDataFeedProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n function deployDataFeedProxy(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDataFeedProxyWithOev(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function computeDataFeedProxyAddress(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyAddress(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDataFeedProxyWithOevAddress(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyWithOevAddress(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function api3ServerV1() external view returns (address);\\n}\\n\",\"keccak256\":\"0x60b3b838b94ead5e5760a897053236ce20954a616a6892c7088ad1cf851290a1\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISelfMulticall.sol\\\";\\n\\ninterface IExtendedSelfMulticall is ISelfMulticall {\\n function getChainId() external view returns (uint256);\\n\\n function getBalance(address account) external view returns (uint256);\\n\\n function containsBytecode(address account) external view returns (bool);\\n\\n function getBlockNumber() external view returns (uint256);\\n\\n function getBlockTimestamp() external view returns (uint256);\\n\\n function getBlockBasefee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xaefe61a623c920d3e39c4779535e280378b44202d11c29a2c96f46f2fe5f420d\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"},\"contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Create2.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(\\n uint256 amount,\\n bytes32 salt,\\n bytes memory bytecode\\n ) internal returns (address addr) {\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n /// @solidity memory-safe-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(\\n bytes32 salt,\\n bytes32 bytecodeHash,\\n address deployer\\n ) internal pure returns (address addr) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n let ptr := mload(0x40) // Get free memory pointer\\n\\n // | | \\u2193 ptr ... \\u2193 ptr + 0x0B (start) ... \\u2193 ptr + 0x20 ... \\u2193 ptr + 0x40 ... |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\\n // | salt | BBBBBBBBBBBBB...BB |\\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\\n // | 0xFF | FF |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\\n // | keccak(start, 85) | \\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191 |\\n\\n mstore(add(ptr, 0x40), bytecodeHash)\\n mstore(add(ptr, 0x20), salt)\\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\\n mstore8(start, 0xff)\\n addr := keccak256(start, 85)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xafc07f37809f74d9c66d6461cc0f85fb5147ab855acd0acc30af4b2272130c61\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b50604051611ae1380380611ae183398101604081905261002f9161009a565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601960248201527f4170693353657276657256312061646472657373207a65726f00000000000000604482015260640160405180910390fd5b6001600160a01b03166080526100ca565b6000602082840312156100ac57600080fd5b81516001600160a01b03811681146100c357600080fd5b9392505050565b6080516119c561011c6000396000818160ad0152818161020b0152818161032901528181610501015281816105a4015281816106fd01528181610805015281816109a60152610a7d01526119c56000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80637dba7458116100765780639ae06c841161005b5780639ae06c841461014a578063d67564bd1461015d578063da1b7d0f1461017057600080fd5b80637dba7458146101245780638dae1a471461013757600080fd5b80632d6a744e146100a857806350763e84146100eb5780635849e5ef146100fe5780636c9d6c0914610111575b600080fd5b6100cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100cf6100f9366004610b72565b610183565b6100cf61010c366004610bbe565b610282565b6100cf61011f366004610bbe565b61040f565b6100cf610132366004610b72565b610547565b6100cf610145366004610bbe565b610653565b6100cf610158366004610b72565b6107ab565b6100cf61016b366004610bbe565b6108cd565b6100cf61017e366004610b72565b6109e1565b6000836101cb5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064015b60405180910390fd5b61027a83836040516101de929190610c26565b604051908190038120906101f460208201610af5565b601f1982820381018352601f9091011660408181527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602083015281018890526060015b60408051601f198184030181529082905261025f9291602001610c66565b60405160208183030381529060405280519060200120610ab7565b949350505050565b6000846102c25760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661030f5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b828260405161031f929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008660405160200161035b91815260200190565b604051602081830303815290604052805190602001208660405161037e90610b02565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f59050801580156103be573d6000803e3d6000fd5b50905084816001600160a01b03167f31d654553da13df7303eb8db83942ff8816845087d3149515a220f5afb37aedd8686866040516103ff93929190610ca4565b60405180910390a3949350505050565b60008461044f5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661049c5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e83836040516104af929190610c26565b604051908190038120906104c560208201610b02565b818103601f199081018352601f90910116604081815260208083018b905281518084038201815282840190925281519101206001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660608401526080830191909152881660a082015260c001610241565b95945050505050565b60008361058a5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b828260405161059a929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000856040516105d090610af5565b6001600160a01b03909216825260208201526040018190604051809103906000f5905080158015610605573d6000803e3d6000fd5b50905083816001600160a01b03167f9a2a9d77287e93a2addaf0c5f3e354d075dfb475f5e197f9abc9b11b922fa9438585604051610644929190610cc7565b60405180910390a39392505050565b6000846106965760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b0384166106e35760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b82826040516106f3929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000868660405161072a90610b0f565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f590508015801561076a573d6000803e3d6000fd5b50905084816001600160a01b03167fff915717e95cf852fef69474bc2bfb3c26ccc15a6978a90ab0a78bc565644d4e8686866040516103ff93929190610ca4565b6000836107eb5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b82826040516107fb929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008560405160200161083791815260200190565b6040516020818303038152906040528051906020012060405161085990610b1c565b6001600160a01b03909216825260208201526040018190604051809103906000f590508015801561088e573d6000803e3d6000fd5b50905083816001600160a01b03167f5212a04ae578b0432469e3d61a28f222c00cf2f5e14d69b0f08c7d327b623d1d8585604051610644929190610cc7565b6000846109105760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b03841661095d5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e8383604051610970929190610c26565b6040519081900381209061098660208201610b0f565b818103601f199081018352601f9091011660408181526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660208401529082018a905288166060820152608001610241565b600083610a215760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b61027a8383604051610a34929190610c26565b60405190819003812090610a4a60208201610b1c565b601f1982820381018352601f90910116604081815260208083018a905281518084038201815282840190925281519101207f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166060830152608082015260a001610241565b6000610ac4838330610acb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6102fd80610cdc83390190565b61035d80610fd983390190565b61035d8061133683390190565b6102fd8061169383390190565b60008083601f840112610b3b57600080fd5b50813567ffffffffffffffff811115610b5357600080fd5b602083019150836020828501011115610b6b57600080fd5b9250929050565b600080600060408486031215610b8757600080fd5b83359250602084013567ffffffffffffffff811115610ba557600080fd5b610bb186828701610b29565b9497909650939450505050565b60008060008060608587031215610bd457600080fd5b8435935060208501356001600160a01b0381168114610bf257600080fd5b9250604085013567ffffffffffffffff811115610c0e57600080fd5b610c1a87828801610b29565b95989497509550505050565b8183823760009101908152919050565b6000815160005b81811015610c575760208185018101518683015201610c3d565b50600093019283525090919050565b600061027a610c758386610c36565b84610c36565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820152600061053e604083018486610c7b565b60208152600061027a602083018486610c7b56fe60c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b060003960008181609c015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e14610046578063370c826b1461009757806357de26a4146100cc575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6100d46100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6040517fa5fc076f0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a5fc076f906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212204c00c55f37d9d93afc24a97a86b86c67275c3e6f0288edd31c678400d06b4dcc64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160f5015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160ce015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a2578063370c826b146100c957806357de26a4146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b610106610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6040517fcfaf49710000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063cfaf4971906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220491c4b81100c410951a4eacc896ef33bf2f2865d87768147c4ca7217d63d79c864736f6c6343000811003360c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b06000396000818160c3015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e1461004657806357de26a414610097578063dcf8da92146100be575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009f6100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6100e57f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6040517fb62408a30000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b62408a3906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212201d061d50f160b049953a990ae61794869544bc65e5a0d25812e444c431cb90f964736f6c63430008110033a2646970667358221220c65d86e8fe1882ee9717fe8fadf286e2319482a7213942b09ed85c68e3cb244164736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a35760003560e01c80637dba7458116100765780639ae06c841161005b5780639ae06c841461014a578063d67564bd1461015d578063da1b7d0f1461017057600080fd5b80637dba7458146101245780638dae1a471461013757600080fd5b80632d6a744e146100a857806350763e84146100eb5780635849e5ef146100fe5780636c9d6c0914610111575b600080fd5b6100cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100cf6100f9366004610b72565b610183565b6100cf61010c366004610bbe565b610282565b6100cf61011f366004610bbe565b61040f565b6100cf610132366004610b72565b610547565b6100cf610145366004610bbe565b610653565b6100cf610158366004610b72565b6107ab565b6100cf61016b366004610bbe565b6108cd565b6100cf61017e366004610b72565b6109e1565b6000836101cb5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064015b60405180910390fd5b61027a83836040516101de929190610c26565b604051908190038120906101f460208201610af5565b601f1982820381018352601f9091011660408181527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602083015281018890526060015b60408051601f198184030181529082905261025f9291602001610c66565b60405160208183030381529060405280519060200120610ab7565b949350505050565b6000846102c25760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661030f5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b828260405161031f929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008660405160200161035b91815260200190565b604051602081830303815290604052805190602001208660405161037e90610b02565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f59050801580156103be573d6000803e3d6000fd5b50905084816001600160a01b03167f31d654553da13df7303eb8db83942ff8816845087d3149515a220f5afb37aedd8686866040516103ff93929190610ca4565b60405180910390a3949350505050565b60008461044f5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661049c5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e83836040516104af929190610c26565b604051908190038120906104c560208201610b02565b818103601f199081018352601f90910116604081815260208083018b905281518084038201815282840190925281519101206001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660608401526080830191909152881660a082015260c001610241565b95945050505050565b60008361058a5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b828260405161059a929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000856040516105d090610af5565b6001600160a01b03909216825260208201526040018190604051809103906000f5905080158015610605573d6000803e3d6000fd5b50905083816001600160a01b03167f9a2a9d77287e93a2addaf0c5f3e354d075dfb475f5e197f9abc9b11b922fa9438585604051610644929190610cc7565b60405180910390a39392505050565b6000846106965760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b0384166106e35760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b82826040516106f3929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000868660405161072a90610b0f565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f590508015801561076a573d6000803e3d6000fd5b50905084816001600160a01b03167fff915717e95cf852fef69474bc2bfb3c26ccc15a6978a90ab0a78bc565644d4e8686866040516103ff93929190610ca4565b6000836107eb5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b82826040516107fb929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008560405160200161083791815260200190565b6040516020818303038152906040528051906020012060405161085990610b1c565b6001600160a01b03909216825260208201526040018190604051809103906000f590508015801561088e573d6000803e3d6000fd5b50905083816001600160a01b03167f5212a04ae578b0432469e3d61a28f222c00cf2f5e14d69b0f08c7d327b623d1d8585604051610644929190610cc7565b6000846109105760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b03841661095d5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e8383604051610970929190610c26565b6040519081900381209061098660208201610b0f565b818103601f199081018352601f9091011660408181526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660208401529082018a905288166060820152608001610241565b600083610a215760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b61027a8383604051610a34929190610c26565b60405190819003812090610a4a60208201610b1c565b601f1982820381018352601f90910116604081815260208083018a905281518084038201815282840190925281519101207f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166060830152608082015260a001610241565b6000610ac4838330610acb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6102fd80610cdc83390190565b61035d80610fd983390190565b61035d8061133683390190565b6102fd8061169383390190565b60008083601f840112610b3b57600080fd5b50813567ffffffffffffffff811115610b5357600080fd5b602083019150836020828501011115610b6b57600080fd5b9250929050565b600080600060408486031215610b8757600080fd5b83359250602084013567ffffffffffffffff811115610ba557600080fd5b610bb186828701610b29565b9497909650939450505050565b60008060008060608587031215610bd457600080fd5b8435935060208501356001600160a01b0381168114610bf257600080fd5b9250604085013567ffffffffffffffff811115610c0e57600080fd5b610c1a87828801610b29565b95989497509550505050565b8183823760009101908152919050565b6000815160005b81811015610c575760208185018101518683015201610c3d565b50600093019283525090919050565b600061027a610c758386610c36565b84610c36565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820152600061053e604083018486610c7b565b60208152600061027a602083018486610c7b56fe60c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b060003960008181609c015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e14610046578063370c826b1461009757806357de26a4146100cc575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6100d46100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6040517fa5fc076f0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a5fc076f906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212204c00c55f37d9d93afc24a97a86b86c67275c3e6f0288edd31c678400d06b4dcc64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160f5015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160ce015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a2578063370c826b146100c957806357de26a4146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b610106610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6040517fcfaf49710000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063cfaf4971906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220491c4b81100c410951a4eacc896ef33bf2f2865d87768147c4ca7217d63d79c864736f6c6343000811003360c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b06000396000818160c3015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e1461004657806357de26a414610097578063dcf8da92146100be575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009f6100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6100e57f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6040517fb62408a30000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b62408a3906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212201d061d50f160b049953a990ae61794869544bc65e5a0d25812e444c431cb90f964736f6c63430008110033a2646970667358221220c65d86e8fe1882ee9717fe8fadf286e2319482a7213942b09ed85c68e3cb244164736f6c63430008110033", + "devdoc": { + "details": "The proxies are deployed normally and not cloned to minimize the gas cost overhead while using them to read data feed values", + "kind": "dev", + "methods": { + "computeDapiProxyAddress(bytes32,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDapiProxyWithOevAddress(bytes32,address,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDataFeedProxyAddress(bytes32,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDataFeedProxyWithOevAddress(bytes32,address,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "constructor": { + "params": { + "_api3ServerV1": "Api3ServerV1 address" + } + }, + "deployDapiProxy(bytes32,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDataFeedProxy(bytes32,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDataFeedProxyWithOev(bytes32,address,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + } + }, + "title": "Contract factory that deterministically deploys proxies that read data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV support", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "api3ServerV1()": { + "notice": "Api3ServerV1 address" + }, + "computeDapiProxyAddress(bytes32,bytes)": { + "notice": "Computes the address of the dAPI proxy" + }, + "computeDapiProxyWithOevAddress(bytes32,address,bytes)": { + "notice": "Computes the address of the dAPI proxy with OEV support" + }, + "computeDataFeedProxyAddress(bytes32,bytes)": { + "notice": "Computes the address of the data feed proxy" + }, + "computeDataFeedProxyWithOevAddress(bytes32,address,bytes)": { + "notice": "Computes the address of the data feed proxy with OEV support" + }, + "deployDapiProxy(bytes32,bytes)": { + "notice": "Deterministically deploys a dAPI proxy" + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "notice": "Deterministically deploys a dAPI proxy with OEV support" + }, + "deployDataFeedProxy(bytes32,bytes)": { + "notice": "Deterministically deploys a data feed proxy" + }, + "deployDataFeedProxyWithOev(bytes32,address,bytes)": { + "notice": "Deterministically deploys a data feed proxy with OEV support" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/blast-sepolia-testnet/solcInputs/9a9784f0166e92dcfa54df2d2c909051.json b/deployments/blast-sepolia-testnet/solcInputs/9a9784f0166e92dcfa54df2d2c909051.json new file mode 100644 index 00000000..12dde86a --- /dev/null +++ b/deployments/blast-sepolia-testnet/solcInputs/9a9784f0166e92dcfa54df2d2c909051.json @@ -0,0 +1,255 @@ +{ + "language": "Solidity", + "sources": { + "contracts/access/AccessControlRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../vendor/@openzeppelin/contracts@4.8.2/access/AccessControl.sol\";\nimport \"../utils/SelfMulticall.sol\";\nimport \"./RoleDeriver.sol\";\nimport \"./interfaces/IAccessControlRegistry.sol\";\n\n/// @title Contract that allows users to manage independent, tree-shaped access\n/// control tables\n/// @notice Multiple contracts can refer to this contract to check if their\n/// users have granted accounts specific roles. Therefore, it aims to keep all\n/// access control roles of its users in this single contract.\n/// @dev Each user is called a \"manager\", and is the only member of their root\n/// role. Starting from this root role, they can create an arbitrary tree of\n/// roles and grant these to accounts. Each role has a description, and roles\n/// adminned by the same role cannot have the same description.\ncontract AccessControlRegistry is\n AccessControl,\n SelfMulticall,\n RoleDeriver,\n IAccessControlRegistry\n{\n /// @notice Initializes the manager by initializing its root role and\n /// granting it to them\n /// @dev Anyone can initialize a manager. An uninitialized manager\n /// attempting to initialize a role will be initialized automatically.\n /// Once a manager is initialized, subsequent initializations have no\n /// effect.\n /// @param manager Manager address to be initialized\n function initializeManager(address manager) public override {\n require(manager != address(0), \"Manager address zero\");\n bytes32 rootRole = _deriveRootRole(manager);\n if (!hasRole(rootRole, manager)) {\n _grantRole(rootRole, manager);\n emit InitializedManager(rootRole, manager, _msgSender());\n }\n }\n\n /// @notice Called by the account to renounce the role\n /// @dev Overriden to disallow managers from renouncing their root roles.\n /// `role` and `account` are not validated because\n /// `AccessControl.renounceRole` will revert if either of them is zero.\n /// @param role Role to be renounced\n /// @param account Account to renounce the role\n function renounceRole(\n bytes32 role,\n address account\n ) public override(AccessControl, IAccessControl) {\n require(\n role != _deriveRootRole(account),\n \"role is root role of account\"\n );\n AccessControl.renounceRole(role, account);\n }\n\n /// @notice Initializes a role by setting its admin role and grants it to\n /// the sender\n /// @dev If the sender should not have the initialized role, they should\n /// explicitly renounce it after initializing it.\n /// Once a role is initialized, subsequent initializations have no effect\n /// other than granting the role to the sender.\n /// The sender must be a member of `adminRole`. `adminRole` value is not\n /// validated because the sender cannot have the `bytes32(0)` role.\n /// If the sender is an uninitialized manager that is initializing a role\n /// directly under their root role, manager initialization will happen\n /// automatically, which will grant the sender `adminRole` and allow them\n /// to initialize the role.\n /// @param adminRole Admin role to be assigned to the initialized role\n /// @param description Human-readable description of the initialized role\n /// @return role Initialized role\n function initializeRoleAndGrantToSender(\n bytes32 adminRole,\n string calldata description\n ) external override returns (bytes32 role) {\n require(bytes(description).length > 0, \"Role description empty\");\n role = _deriveRole(adminRole, description);\n // AccessControl roles have `DEFAULT_ADMIN_ROLE` (i.e., `bytes32(0)`)\n // as their `adminRole` by default. No account in AccessControlRegistry\n // can possibly have that role, which means all initialized roles will\n // have non-default admin roles, and vice versa.\n if (getRoleAdmin(role) == DEFAULT_ADMIN_ROLE) {\n if (adminRole == _deriveRootRole(_msgSender())) {\n initializeManager(_msgSender());\n }\n _setRoleAdmin(role, adminRole);\n emit InitializedRole(role, adminRole, description, _msgSender());\n }\n grantRole(role, _msgSender());\n }\n}\n" + }, + "contracts/access/AccessControlRegistryAdminned.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../utils/SelfMulticall.sol\";\nimport \"./RoleDeriver.sol\";\nimport \"./interfaces/IAccessControlRegistryAdminned.sol\";\nimport \"./interfaces/IAccessControlRegistry.sol\";\n\n/// @title Contract to be inherited by contracts whose adminship functionality\n/// will be implemented using AccessControlRegistry\ncontract AccessControlRegistryAdminned is\n SelfMulticall,\n RoleDeriver,\n IAccessControlRegistryAdminned\n{\n /// @notice AccessControlRegistry contract address\n address public immutable override accessControlRegistry;\n\n /// @notice Admin role description\n string public override adminRoleDescription;\n\n bytes32 internal immutable adminRoleDescriptionHash;\n\n /// @dev Contracts deployed with the same admin role descriptions will have\n /// the same roles, meaning that granting an account a role will authorize\n /// it in multiple contracts. Unless you want your deployed contract to\n /// share the role configuration of another contract, use a unique admin\n /// role description.\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription\n ) {\n require(_accessControlRegistry != address(0), \"ACR address zero\");\n require(\n bytes(_adminRoleDescription).length > 0,\n \"Admin role description empty\"\n );\n accessControlRegistry = _accessControlRegistry;\n adminRoleDescription = _adminRoleDescription;\n adminRoleDescriptionHash = keccak256(\n abi.encodePacked(_adminRoleDescription)\n );\n }\n\n /// @notice Derives the admin role for the specific manager address\n /// @param manager Manager address\n /// @return adminRole Admin role\n function _deriveAdminRole(\n address manager\n ) internal view returns (bytes32 adminRole) {\n adminRole = _deriveRole(\n _deriveRootRole(manager),\n adminRoleDescriptionHash\n );\n }\n}\n" + }, + "contracts/access/AccessControlRegistryAdminnedWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./AccessControlRegistryAdminned.sol\";\nimport \"./interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\n/// @title Contract to be inherited by contracts with manager whose adminship\n/// functionality will be implemented using AccessControlRegistry\n/// @notice The manager address here is expected to belong to an\n/// AccessControlRegistry user that is a multisig/DAO\ncontract AccessControlRegistryAdminnedWithManager is\n AccessControlRegistryAdminned,\n IAccessControlRegistryAdminnedWithManager\n{\n /// @notice Address of the manager that manages the related\n /// AccessControlRegistry roles\n /// @dev The mutability of the manager role can be implemented by\n /// designating an OwnableCallForwarder contract as the manager. The\n /// ownership of this contract can then be transferred, effectively\n /// transferring managership.\n address public immutable override manager;\n\n /// @notice Admin role\n /// @dev Since `manager` is immutable, so is `adminRole`\n bytes32 public immutable override adminRole;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminned(\n _accessControlRegistry,\n _adminRoleDescription\n )\n {\n require(_manager != address(0), \"Manager address zero\");\n manager = _manager;\n adminRole = _deriveAdminRole(_manager);\n }\n}\n" + }, + "contracts/access/HashRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol\";\nimport \"./interfaces/IHashRegistry.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/ECDSA.sol\";\n\n/// @title A contract where a value for each hash type can be registered using\n/// the signatures of the respective signers that are set by the contract owner\n/// @notice Hashes are identified by a unique \"hash type\", which is a `bytes32`\n/// type that can be determined based on any arbitrary convention. The contract\n/// owner can set a list of signers for each hash type. For a hash value to be\n/// registered, its signers must be set by the contract owner, and valid\n/// signatures by each signer must be provided. The hash values are bundled\n/// with timestamps that act as nonces, meaning that each registration must\n/// be with a larger timestamp than the previous. The contract owner can\n/// override previously registered hashes.\n/// A signer can sign a delegation message that allows the delegate to sign\n/// hashes on their behalf across all instances of this contract until the\n/// specified time. This delegation is irrevocable by design (as revoking across\n/// all instances would be error-prone). To undo an unwanted delegation, the\n/// signer must be swapped out by the contract owner until the delegation runs\n/// out.\n/// @dev This contract can be used in standalone form to be referred to through\n/// external calls, or inherited by the contract that will access the\n/// registered hashes internally.\n/// HashRegistry is intended for use-cases where signatures and delegations\n/// need to apply universally across domains, which is why it is blind to the\n/// domain (unlike ERC-712). However, the inheriting contract can implement the\n/// type hashes to be domain-specific.\ncontract HashRegistry is Ownable, IHashRegistry {\n struct Hash {\n bytes32 value;\n uint256 timestamp;\n }\n\n /// @notice Hash type to the last registered value and timestamp\n mapping(bytes32 => Hash) public override hashes;\n\n /// @notice Hash type to the hash of the array of signer addresses\n mapping(bytes32 => bytes32) public override hashTypeToSignersHash;\n\n uint256 private constant ECDSA_SIGNATURE_LENGTH = 65;\n\n // Length of abi.encode(uint256, bytes, bytes), where the bytes types are\n // ECDSA signatures padded to the next largest multiple of 32 bytes, which\n // is 96\n uint256 private constant DELEGATED_SIGNATURE_LENGTH =\n 32 + 32 + 32 + (32 + 96) + (32 + 96);\n\n /// @param owner_ Owner address\n constructor(address owner_) {\n require(owner_ != address(0), \"Owner address zero\");\n _transferOwnership(owner_);\n }\n\n /// @notice Returns the owner address\n /// @return Owner address\n function owner()\n public\n view\n virtual\n override(Ownable, IOwnable)\n returns (address)\n {\n return super.owner();\n }\n\n /// @notice Called by the owner to renounce the ownership of the contract\n function renounceOwnership() public virtual override(Ownable, IOwnable) {\n return super.renounceOwnership();\n }\n\n /// @notice Called by the owner to transfer the ownership of the contract\n /// @param newOwner New owner address\n function transferOwnership(\n address newOwner\n ) public virtual override(Ownable, IOwnable) {\n return super.transferOwnership(newOwner);\n }\n\n /// @notice Called by the contract owner to set signers for a hash type.\n /// The signer addresses must be in ascending order.\n /// @param hashType Hash type\n /// @param signers Signer addresses\n function setSigners(\n bytes32 hashType,\n address[] calldata signers\n ) external override onlyOwner {\n require(hashType != bytes32(0), \"Hash type zero\");\n uint256 signersCount = signers.length;\n require(signersCount != 0, \"Signers empty\");\n require(signers[0] != address(0), \"First signer address zero\");\n for (uint256 ind = 1; ind < signersCount; ind++) {\n require(\n signers[ind] > signers[ind - 1],\n \"Signers not in ascending order\"\n );\n }\n hashTypeToSignersHash[hashType] = keccak256(abi.encodePacked(signers));\n emit SetSigners(hashType, signers);\n }\n\n /// @notice Called by the owner to set a hash. Overrides previous\n /// registrations and is allowed to set the value to `bytes32(0)`.\n /// @param hashType Hash type\n /// @param hashValue Hash value\n function setHash(\n bytes32 hashType,\n bytes32 hashValue\n ) external override onlyOwner {\n hashes[hashType] = Hash({value: hashValue, timestamp: block.timestamp});\n emit SetHash(hashType, hashValue, block.timestamp);\n }\n\n /// @notice Registers the hash value and timestamp for the respective type.\n /// The hash value cannot be zero.\n /// The timestamp must not exceed the block timestamp, yet be larger than\n /// the timestamp of the previous registration.\n /// The signers must have been set for the hash type, and the signatures\n /// must be sorted for the respective signer addresses to be in ascending\n /// order.\n /// Each signature can either be a standalone signature by the respective\n /// signer, or a signature by the signer's delegate, encoded along with\n /// the delegation end timestamp and delegation signature.\n /// @param hashType Hash type\n /// @param hashValue Hash value\n /// @param hashTimestamp Hash timestamp\n /// @param signatures Signatures\n function registerHash(\n bytes32 hashType,\n bytes32 hashValue,\n uint256 hashTimestamp,\n bytes[] calldata signatures\n ) external override {\n require(hashValue != bytes32(0), \"Hash value zero\");\n require(hashTimestamp <= block.timestamp, \"Hash timestamp from future\");\n require(\n hashTimestamp > hashes[hashType].timestamp,\n \"Hash timestamp not more recent\"\n );\n bytes32 signersHash = hashTypeToSignersHash[hashType];\n require(signersHash != bytes32(0), \"Signers not set\");\n uint256 signaturesCount = signatures.length;\n address[] memory signers = new address[](signaturesCount);\n bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(\n keccak256(abi.encodePacked(hashType, hashValue, hashTimestamp))\n );\n for (uint256 ind = 0; ind < signaturesCount; ind++) {\n uint256 signatureLength = signatures[ind].length;\n if (signatureLength == ECDSA_SIGNATURE_LENGTH) {\n signers[ind] = ECDSA.recover(\n ethSignedMessageHash,\n signatures[ind]\n );\n } else if (signatureLength == DELEGATED_SIGNATURE_LENGTH) {\n (\n uint256 delegationEndTimestamp,\n bytes memory delegationSignature,\n bytes memory hashSignature\n ) = abi.decode(signatures[ind], (uint256, bytes, bytes));\n require(\n block.timestamp < delegationEndTimestamp,\n \"Delegation ended\"\n );\n signers[ind] = ECDSA.recover(\n ECDSA.toEthSignedMessageHash(\n keccak256(\n abi.encodePacked(\n signatureDelegationHashType(),\n ECDSA.recover(\n ethSignedMessageHash,\n hashSignature\n ),\n delegationEndTimestamp\n )\n )\n ),\n delegationSignature\n );\n } else {\n revert(\"Invalid signature length\");\n }\n }\n require(\n signersHash == keccak256(abi.encodePacked(signers)),\n \"Signature mismatch\"\n );\n hashes[hashType] = Hash({value: hashValue, timestamp: hashTimestamp});\n emit RegisteredHash(hashType, hashValue, hashTimestamp);\n }\n\n /// @notice Returns the signature delegation hash type used in delegation\n /// signatures\n /// @dev Delegation signatures signed with a signature delegation hash type\n /// will apply universally across all HashRegistry instances that use that\n /// same signature delegation hash type. The inheriting contract can\n /// specify a special signature delegation hash type by overriding this\n /// function.\n /// @return Signature delegation hash type\n function signatureDelegationHashType()\n public\n view\n virtual\n override\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(\"HashRegistry signature delegation\"));\n }\n\n /// @notice Returns get the hash value for the type\n /// @param hashType Hash type\n /// @return hashValue Hash value\n function getHashValue(\n bytes32 hashType\n ) external view override returns (bytes32 hashValue) {\n hashValue = hashes[hashType].value;\n }\n}\n" + }, + "contracts/access/interfaces/IAccessControlRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol\";\nimport \"../../utils/interfaces/ISelfMulticall.sol\";\n\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\n event InitializedManager(\n bytes32 indexed rootRole,\n address indexed manager,\n address sender\n );\n\n event InitializedRole(\n bytes32 indexed role,\n bytes32 indexed adminRole,\n string description,\n address sender\n );\n\n function initializeManager(address manager) external;\n\n function initializeRoleAndGrantToSender(\n bytes32 adminRole,\n string calldata description\n ) external returns (bytes32 role);\n}\n" + }, + "contracts/access/interfaces/IAccessControlRegistryAdminned.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../utils/interfaces/ISelfMulticall.sol\";\n\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\n function accessControlRegistry() external view returns (address);\n\n function adminRoleDescription() external view returns (string memory);\n}\n" + }, + "contracts/access/interfaces/IAccessControlRegistryAdminnedWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlRegistryAdminned.sol\";\n\ninterface IAccessControlRegistryAdminnedWithManager is\n IAccessControlRegistryAdminned\n{\n function manager() external view returns (address);\n\n function adminRole() external view returns (bytes32);\n}\n" + }, + "contracts/access/interfaces/IHashRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IOwnable.sol\";\n\ninterface IHashRegistry is IOwnable {\n event SetSigners(bytes32 indexed hashType, address[] signers);\n\n event SetHash(\n bytes32 indexed hashType,\n bytes32 hashValue,\n uint256 hashTimestamp\n );\n\n event RegisteredHash(\n bytes32 indexed hashType,\n bytes32 hashValue,\n uint256 hashTimestamp\n );\n\n function setSigners(bytes32 hashType, address[] calldata signers) external;\n\n function setHash(bytes32 hashType, bytes32 hashValue) external;\n\n function registerHash(\n bytes32 hashType,\n bytes32 hashValue,\n uint256 hashTimestamp,\n bytes[] calldata signatures\n ) external;\n\n function signatureDelegationHashType() external view returns (bytes32);\n\n function getHashValue(\n bytes32 hashType\n ) external view returns (bytes32 hashValue);\n\n function hashes(\n bytes32 hashType\n ) external view returns (bytes32 hashValue, uint256 hashTimestamp);\n\n function hashTypeToSignersHash(\n bytes32 hashType\n ) external view returns (bytes32 signersHash);\n}\n" + }, + "contracts/access/interfaces/IOwnable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOwnable {\n function owner() external view returns (address);\n\n function renounceOwnership() external;\n\n function transferOwnership(address newOwner) external;\n}\n" + }, + "contracts/access/interfaces/IOwnableCallForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOwnableCallForwarder {\n function forwardCall(\n address forwardTarget,\n bytes calldata forwardedCalldata\n ) external payable returns (bytes memory returnedData);\n}\n" + }, + "contracts/access/OwnableCallForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../vendor/@openzeppelin/contracts@4.8.2/access/Ownable.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.8.2/utils/Address.sol\";\nimport \"./interfaces/IOwnableCallForwarder.sol\";\n\n/// @title Contract that forwards the calls that its owner sends\n/// @notice AccessControlRegistry users that want their access control tables\n/// to be transferrable (e.g., a DAO) will use this forwarder instead of\n/// interacting with it directly. There are cases where this transferrability\n/// is not desired, e.g., if the user is an Airnode and is immutably associated\n/// with a single address, in which case the manager will interact with\n/// AccessControlRegistry directly.\ncontract OwnableCallForwarder is Ownable, IOwnableCallForwarder {\n /// @param _owner Owner address\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @notice Forwards the calldata and the value to the target address if\n /// the sender is the owner and returns the data\n /// @param forwardTarget Target address that the calldata will be forwarded\n /// to\n /// @param forwardedCalldata Calldata to be forwarded to the target address\n /// @return returnedData Data returned by the forwarded call\n function forwardCall(\n address forwardTarget,\n bytes calldata forwardedCalldata\n ) external payable override onlyOwner returns (bytes memory returnedData) {\n returnedData = Address.functionCallWithValue(\n forwardTarget,\n forwardedCalldata,\n msg.value\n );\n }\n}\n" + }, + "contracts/access/RoleDeriver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will derive\n/// AccessControlRegistry roles\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\n/// derive roles, it should inherit this contract instead of re-implementing\n/// the logic\ncontract RoleDeriver {\n /// @notice Derives the root role of the manager\n /// @param manager Manager address\n /// @return rootRole Root role\n function _deriveRootRole(\n address manager\n ) internal pure returns (bytes32 rootRole) {\n rootRole = keccak256(abi.encodePacked(manager));\n }\n\n /// @notice Derives the role using its admin role and description\n /// @dev This implies that roles adminned by the same role cannot have the\n /// same description\n /// @param adminRole Admin role\n /// @param description Human-readable description of the role\n /// @return role Role\n function _deriveRole(\n bytes32 adminRole,\n string memory description\n ) internal pure returns (bytes32 role) {\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\n }\n\n /// @notice Derives the role using its admin role and description hash\n /// @dev This implies that roles adminned by the same role cannot have the\n /// same description\n /// @param adminRole Admin role\n /// @param descriptionHash Hash of the human-readable description of the\n /// role\n /// @return role Role\n function _deriveRole(\n bytes32 adminRole,\n bytes32 descriptionHash\n ) internal pure returns (bytes32 role) {\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/Median.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Sort.sol\";\nimport \"./QuickSelect.sol\";\n\n/// @title Contract to be inherited by contracts that will calculate the median\n/// of an array\n/// @notice The operation will be in-place, i.e., the array provided as the\n/// argument will be modified.\ncontract Median is Sort, Quickselect {\n /// @notice Returns the median of the array\n /// @dev Uses an unrolled sorting implementation for shorter arrays and\n /// quickselect for longer arrays for gas cost efficiency\n /// @param array Array whose median is to be calculated\n /// @return Median of the array\n function median(int256[] memory array) internal pure returns (int256) {\n uint256 arrayLength = array.length;\n if (arrayLength <= MAX_SORT_LENGTH) {\n sort(array);\n if (arrayLength % 2 == 1) {\n return array[arrayLength / 2];\n } else {\n assert(arrayLength != 0);\n unchecked {\n return\n average(\n array[arrayLength / 2 - 1],\n array[arrayLength / 2]\n );\n }\n }\n } else {\n if (arrayLength % 2 == 1) {\n return array[quickselectK(array, arrayLength / 2)];\n } else {\n uint256 mid1;\n uint256 mid2;\n unchecked {\n (mid1, mid2) = quickselectKPlusOne(\n array,\n arrayLength / 2 - 1\n );\n }\n return average(array[mid1], array[mid2]);\n }\n }\n }\n\n /// @notice Averages two signed integers without overflowing\n /// @param x Integer x\n /// @param y Integer y\n /// @return Average of integers x and y\n function average(int256 x, int256 y) private pure returns (int256) {\n unchecked {\n int256 averageRoundedDownToNegativeInfinity = (x >> 1) +\n (y >> 1) +\n (x & y & 1);\n // If the average rounded down to negative infinity is negative\n // (i.e., its 256th sign bit is set), and one of (x, y) is even and\n // the other one is odd (i.e., the 1st bit of their xor is set),\n // add 1 to round the average down to zero instead.\n // We will typecast the signed integer to unsigned to logical-shift\n // int256(uint256(signedInt)) >> 255 ~= signedInt >>> 255\n return\n averageRoundedDownToNegativeInfinity +\n (int256(\n (uint256(averageRoundedDownToNegativeInfinity) >> 255)\n ) & (x ^ y));\n }\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/QuickSelect.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will calculate the index\n/// of the k-th and optionally (k+1)-th largest elements in the array\n/// @notice Uses quickselect, which operates in-place, i.e., the array provided\n/// as the argument will be modified.\ncontract Quickselect {\n /// @notice Returns the index of the k-th largest element in the array\n /// @param array Array in which k-th largest element will be searched\n /// @param k K\n /// @return indK Index of the k-th largest element\n function quickselectK(\n int256[] memory array,\n uint256 k\n ) internal pure returns (uint256 indK) {\n uint256 arrayLength = array.length;\n assert(arrayLength > 0);\n unchecked {\n (indK, ) = quickselect(array, 0, arrayLength - 1, k, false);\n }\n }\n\n /// @notice Returns the index of the k-th and (k+1)-th largest elements in\n /// the array\n /// @param array Array in which k-th and (k+1)-th largest elements will be\n /// searched\n /// @param k K\n /// @return indK Index of the k-th largest element\n /// @return indKPlusOne Index of the (k+1)-th largest element\n function quickselectKPlusOne(\n int256[] memory array,\n uint256 k\n ) internal pure returns (uint256 indK, uint256 indKPlusOne) {\n uint256 arrayLength = array.length;\n assert(arrayLength > 1);\n unchecked {\n (indK, indKPlusOne) = quickselect(\n array,\n 0,\n arrayLength - 1,\n k,\n true\n );\n }\n }\n\n /// @notice Returns the index of the k-th largest element in the specified\n /// section of the (potentially unsorted) array\n /// @param array Array in which K will be searched for\n /// @param lo Starting index of the section of the array that K will be\n /// searched in\n /// @param hi Last index of the section of the array that K will be\n /// searched in\n /// @param k K\n /// @param selectKPlusOne If the index of the (k+1)-th largest element is\n /// to be returned\n /// @return indK Index of the k-th largest element\n /// @return indKPlusOne Index of the (k+1)-th largest element (only set if\n /// `selectKPlusOne` is `true`)\n function quickselect(\n int256[] memory array,\n uint256 lo,\n uint256 hi,\n uint256 k,\n bool selectKPlusOne\n ) private pure returns (uint256 indK, uint256 indKPlusOne) {\n if (lo == hi) {\n return (k, 0);\n }\n uint256 indPivot = partition(array, lo, hi);\n if (k < indPivot) {\n unchecked {\n (indK, ) = quickselect(array, lo, indPivot - 1, k, false);\n }\n } else if (k > indPivot) {\n unchecked {\n (indK, ) = quickselect(array, indPivot + 1, hi, k, false);\n }\n } else {\n indK = indPivot;\n }\n // Since Quickselect ends in the array being partitioned around the\n // k-th largest element, we can continue searching towards right for\n // the (k+1)-th largest element, which is useful in calculating the\n // median of an array with even length\n if (selectKPlusOne) {\n unchecked {\n indKPlusOne = indK + 1;\n }\n uint256 i;\n unchecked {\n i = indKPlusOne + 1;\n }\n uint256 arrayLength = array.length;\n for (; i < arrayLength; ) {\n if (array[i] < array[indKPlusOne]) {\n indKPlusOne = i;\n }\n unchecked {\n i++;\n }\n }\n }\n }\n\n /// @notice Partitions the array into two around a pivot\n /// @param array Array that will be partitioned\n /// @param lo Starting index of the section of the array that will be\n /// partitioned\n /// @param hi Last index of the section of the array that will be\n /// partitioned\n /// @return pivotInd Pivot index\n function partition(\n int256[] memory array,\n uint256 lo,\n uint256 hi\n ) private pure returns (uint256 pivotInd) {\n if (lo == hi) {\n return lo;\n }\n int256 pivot = array[lo];\n uint256 i = lo;\n unchecked {\n pivotInd = hi + 1;\n }\n while (true) {\n do {\n unchecked {\n i++;\n }\n } while (i < array.length && array[i] < pivot);\n do {\n unchecked {\n pivotInd--;\n }\n } while (array[pivotInd] > pivot);\n if (i >= pivotInd) {\n (array[lo], array[pivotInd]) = (array[pivotInd], array[lo]);\n return pivotInd;\n }\n (array[i], array[pivotInd]) = (array[pivotInd], array[i]);\n }\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/Sort.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will sort an array using\n/// an unrolled implementation\n/// @notice The operation will be in-place, i.e., the array provided as the\n/// argument will be modified.\ncontract Sort {\n uint256 internal constant MAX_SORT_LENGTH = 9;\n\n /// @notice Sorts the array\n /// @param array Array to be sorted\n function sort(int256[] memory array) internal pure {\n uint256 arrayLength = array.length;\n require(arrayLength <= MAX_SORT_LENGTH, \"Array too long to sort\");\n // Do a binary search\n if (arrayLength < 6) {\n // Possible lengths: 1, 2, 3, 4, 5\n if (arrayLength < 4) {\n // Possible lengths: 1, 2, 3\n if (arrayLength == 3) {\n // Length: 3\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 0, 1);\n } else if (arrayLength == 2) {\n // Length: 2\n swapIfFirstIsLarger(array, 0, 1);\n }\n // Do nothing for Length: 1\n } else {\n // Possible lengths: 4, 5\n if (arrayLength == 5) {\n // Length: 5\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 1, 2);\n } else {\n // Length: 4\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 1, 2);\n }\n }\n } else {\n // Possible lengths: 6, 7, 8, 9\n if (arrayLength < 8) {\n // Possible lengths: 6, 7\n if (arrayLength == 7) {\n // Length: 7\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 4, 6);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 2, 6);\n swapIfFirstIsLarger(array, 1, 5);\n swapIfFirstIsLarger(array, 0, 4);\n swapIfFirstIsLarger(array, 2, 5);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n } else {\n // Length: 6\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 2, 3);\n }\n } else {\n // Possible lengths: 8, 9\n if (arrayLength == 9) {\n // Length: 9\n swapIfFirstIsLarger(array, 1, 8);\n swapIfFirstIsLarger(array, 2, 7);\n swapIfFirstIsLarger(array, 3, 6);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 1, 4);\n swapIfFirstIsLarger(array, 5, 8);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 2, 6);\n swapIfFirstIsLarger(array, 7, 8);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 5, 7);\n swapIfFirstIsLarger(array, 4, 6);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 7, 8);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n } else {\n // Length: 8\n swapIfFirstIsLarger(array, 0, 7);\n swapIfFirstIsLarger(array, 1, 6);\n swapIfFirstIsLarger(array, 2, 5);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 4, 7);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 3, 4);\n }\n }\n }\n }\n\n /// @notice Swaps two elements of an array if the first element is greater\n /// than the second\n /// @param array Array whose elements are to be swapped\n /// @param ind1 Index of the first element\n /// @param ind2 Index of the second element\n function swapIfFirstIsLarger(\n int256[] memory array,\n uint256 ind1,\n uint256 ind2\n ) private pure {\n if (array[ind1] > array[ind2]) {\n (array[ind1], array[ind2]) = (array[ind2], array[ind1]);\n }\n }\n}\n" + }, + "contracts/api3-server-v1/AirseekerRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol\";\nimport \"../utils/ExtendedSelfMulticall.sol\";\nimport \"./interfaces/IAirseekerRegistry.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.9.5/utils/structs/EnumerableSet.sol\";\nimport \"./interfaces/IApi3ServerV1.sol\";\n\n/// @title A contract where active data feeds and their specs are registered by\n/// the contract owner for the Airseeker that serves them to refer to\n/// @notice Airseeker is an application that pushes API provider-signed data to\n/// chain when certain conditions are met so that the data feeds served on the\n/// Api3ServerV1 contract are updated according to the respective specs. In\n/// other words, this contract is an on-chain configuration file for an\n/// Airseeker (or multiple Airseekers in a setup with redundancy).\n/// The Airseeker must know which data feeds are active (and thus need to be\n/// updated), the constituting Airnode (the oracle node that API providers\n/// operate to sign data) addresses and request template IDs, what the\n/// respective on-chain data feed values are, what the update parameters are,\n/// and the URL of the signed APIs (from which Airseeker can fetch signed data)\n/// that are hosted by the respective API providers.\n/// The contract owner is responsible with leaving the state of this contract\n/// in a way that Airseeker expects. For example, if a dAPI name is activated\n/// without registering the respective data feed, the Airseeker will not have\n/// access to the data that it needs to execute updates.\ncontract AirseekerRegistry is\n Ownable,\n ExtendedSelfMulticall,\n IAirseekerRegistry\n{\n using EnumerableSet for EnumerableSet.Bytes32Set;\n\n /// @notice Maximum number of Beacons in a Beacon set that can be\n /// registered\n /// @dev Api3ServerV1 introduces the concept of a Beacon, which is a\n /// single-source data feed. Api3ServerV1 allows Beacons to be read\n /// individually, or arbitrary combinations of them to be aggregated\n /// on-chain to form multiple-source data feeds, which are called Beacon\n /// sets. This contract does not support Beacon sets that consist of more\n /// than `MAXIMUM_BEACON_COUNT_IN_SET` Beacons to be registered.\n uint256 public constant override MAXIMUM_BEACON_COUNT_IN_SET = 21;\n\n /// @notice Maximum encoded update parameters length\n uint256 public constant override MAXIMUM_UPDATE_PARAMETERS_LENGTH = 1024;\n\n /// @notice Maximum signed API URL length\n uint256 public constant override MAXIMUM_SIGNED_API_URL_LENGTH = 256;\n\n /// @notice Api3ServerV1 contract address\n address public immutable override api3ServerV1;\n\n /// @notice Airnode address to signed API URL\n /// @dev An Airseeker can be configured to refer to additional signed APIs\n /// than the ones whose URLs are stored in this contract for redundancy\n mapping(address => string) public override airnodeToSignedApiUrl;\n\n /// @notice Data feed ID to encoded details\n mapping(bytes32 => bytes) public override dataFeedIdToDetails;\n\n // Api3ServerV1 uses Beacon IDs (see the `deriveBeaconId()` implementation)\n // and Beacon set IDs (see the `deriveBeaconSetId()` implementation) to\n // address data feeds. We use data feed ID as a general term to refer to a\n // Beacon ID/Beacon set ID.\n // A data feed ID is immutable (i.e., it always points to the same Beacon\n // or Beacon set). Api3ServerV1 allows a dAPI name to be pointed to a data\n // feed ID by privileged accounts to implement a mutable data feed\n // addressing scheme.\n // If the data feed ID or dAPI name should be used to read a data feed\n // depends on the use case. To support both schemes, AirseekerRegistry\n // allows data feeds specs to be defined with either the data feed ID or\n // the dAPI name.\n EnumerableSet.Bytes32Set private activeDataFeedIds;\n\n EnumerableSet.Bytes32Set private activeDapiNames;\n\n // Considering that the update parameters are typically reused between data\n // feeds, a hash map is used to avoid storing the same update parameters\n // redundantly\n mapping(bytes32 => bytes32) private dataFeedIdToUpdateParametersHash;\n\n mapping(bytes32 => bytes32) private dapiNameToUpdateParametersHash;\n\n mapping(bytes32 => bytes) private updateParametersHashToValue;\n\n // Length of abi.encode(address, bytes32)\n uint256 private constant DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON =\n 32 + 32;\n\n // Length of abi.encode(address[2], bytes32[2])\n uint256\n private constant DATA_FEED_DETAILS_LENGTH_FOR_BEACON_SET_WITH_TWO_BEACONS =\n 32 + 32 + (32 + 2 * 32) + (32 + 2 * 32);\n\n // Length of\n // abi.encode(address[MAXIMUM_BEACON_COUNT_IN_SET], bytes32[MAXIMUM_BEACON_COUNT_IN_SET])\n uint256 private constant MAXIMUM_DATA_FEED_DETAILS_LENGTH =\n 32 +\n 32 +\n (32 + MAXIMUM_BEACON_COUNT_IN_SET * 32) +\n (32 + MAXIMUM_BEACON_COUNT_IN_SET * 32);\n\n /// @dev Reverts if the data feed ID is zero\n /// @param dataFeedId Data feed ID\n modifier onlyNonZeroDataFeedId(bytes32 dataFeedId) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n _;\n }\n\n /// @dev Reverts if the dAPI name is zero\n /// @param dapiName dAPI name\n modifier onlyNonZeroDapiName(bytes32 dapiName) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n _;\n }\n\n /// @dev Reverts if the update parameters are too long\n /// @param updateParameters Update parameters\n modifier onlyValidUpdateParameters(bytes calldata updateParameters) {\n require(\n updateParameters.length <= MAXIMUM_UPDATE_PARAMETERS_LENGTH,\n \"Update parameters too long\"\n );\n _;\n }\n\n /// @param owner_ Owner address\n /// @param api3ServerV1_ Api3ServerV1 contract address\n constructor(address owner_, address api3ServerV1_) {\n require(owner_ != address(0), \"Owner address zero\");\n require(api3ServerV1_ != address(0), \"Api3ServerV1 address zero\");\n _transferOwnership(owner_);\n api3ServerV1 = api3ServerV1_;\n }\n\n /// @notice Returns the owner address\n /// @return Owner address\n function owner() public view override(Ownable, IOwnable) returns (address) {\n return super.owner();\n }\n\n /// @notice Overriden to be disabled\n function renounceOwnership() public pure override(Ownable, IOwnable) {\n revert(\"Ownership cannot be renounced\");\n }\n\n /// @notice Overriden to be disabled\n function transferOwnership(\n address\n ) public pure override(Ownable, IOwnable) {\n revert(\"Ownership cannot be transferred\");\n }\n\n /// @notice Called by the owner to set the data feed ID to be activated\n /// @param dataFeedId Data feed ID\n function setDataFeedIdToBeActivated(\n bytes32 dataFeedId\n ) external override onlyOwner onlyNonZeroDataFeedId(dataFeedId) {\n if (activeDataFeedIds.add(dataFeedId)) {\n emit ActivatedDataFeedId(dataFeedId);\n }\n }\n\n /// @notice Called by the owner to set the dAPI name to be activated\n /// @param dapiName dAPI name\n function setDapiNameToBeActivated(\n bytes32 dapiName\n ) external override onlyOwner onlyNonZeroDapiName(dapiName) {\n if (activeDapiNames.add(dapiName)) {\n emit ActivatedDapiName(dapiName);\n }\n }\n\n /// @notice Called by the owner to set the data feed ID to be deactivated\n /// @param dataFeedId Data feed ID\n function setDataFeedIdToBeDeactivated(\n bytes32 dataFeedId\n ) external override onlyOwner onlyNonZeroDataFeedId(dataFeedId) {\n if (activeDataFeedIds.remove(dataFeedId)) {\n emit DeactivatedDataFeedId(dataFeedId);\n }\n }\n\n /// @notice Called by the owner to set the dAPI name to be deactivated\n /// @param dapiName dAPI name\n function setDapiNameToBeDeactivated(\n bytes32 dapiName\n ) external override onlyOwner onlyNonZeroDapiName(dapiName) {\n if (activeDapiNames.remove(dapiName)) {\n emit DeactivatedDapiName(dapiName);\n }\n }\n\n /// @notice Called by the owner to set the data feed ID update parameters.\n /// The update parameters must be encoded in a format that Airseeker\n /// expects.\n /// @param dataFeedId Data feed ID\n /// @param updateParameters Update parameters\n function setDataFeedIdUpdateParameters(\n bytes32 dataFeedId,\n bytes calldata updateParameters\n )\n external\n override\n onlyOwner\n onlyNonZeroDataFeedId(dataFeedId)\n onlyValidUpdateParameters(updateParameters)\n {\n bytes32 updateParametersHash = keccak256(updateParameters);\n if (\n dataFeedIdToUpdateParametersHash[dataFeedId] != updateParametersHash\n ) {\n dataFeedIdToUpdateParametersHash[dataFeedId] = updateParametersHash;\n if (\n updateParametersHashToValue[updateParametersHash].length !=\n updateParameters.length\n ) {\n updateParametersHashToValue[\n updateParametersHash\n ] = updateParameters;\n }\n emit UpdatedDataFeedIdUpdateParameters(\n dataFeedId,\n updateParameters\n );\n }\n }\n\n /// @notice Called by the owner to set the dAPI name update parameters.\n /// The update parameters must be encoded in a format that Airseeker\n /// expects.\n /// @param dapiName dAPI name\n /// @param updateParameters Update parameters\n function setDapiNameUpdateParameters(\n bytes32 dapiName,\n bytes calldata updateParameters\n )\n external\n override\n onlyOwner\n onlyNonZeroDapiName(dapiName)\n onlyValidUpdateParameters(updateParameters)\n {\n bytes32 updateParametersHash = keccak256(updateParameters);\n if (dapiNameToUpdateParametersHash[dapiName] != updateParametersHash) {\n dapiNameToUpdateParametersHash[dapiName] = updateParametersHash;\n if (\n updateParametersHashToValue[updateParametersHash].length !=\n updateParameters.length\n ) {\n updateParametersHashToValue[\n updateParametersHash\n ] = updateParameters;\n }\n emit UpdatedDapiNameUpdateParameters(dapiName, updateParameters);\n }\n }\n\n /// @notice Called by the owner to set the signed API URL for the Airnode.\n /// The signed API must implement the specific interface that Airseeker\n /// expects.\n /// @param airnode Airnode address\n /// @param signedApiUrl Signed API URL\n function setSignedApiUrl(\n address airnode,\n string calldata signedApiUrl\n ) external override onlyOwner {\n require(airnode != address(0), \"Airnode address zero\");\n require(\n abi.encodePacked(signedApiUrl).length <=\n MAXIMUM_SIGNED_API_URL_LENGTH,\n \"Signed API URL too long\"\n );\n if (\n keccak256(abi.encodePacked(airnodeToSignedApiUrl[airnode])) !=\n keccak256(abi.encodePacked(signedApiUrl))\n ) {\n airnodeToSignedApiUrl[airnode] = signedApiUrl;\n emit UpdatedSignedApiUrl(airnode, signedApiUrl);\n }\n }\n\n /// @notice Registers the data feed. In the case that the data feed is a\n /// Beacon, the details should be the ABI-encoded Airnode address and\n /// template ID. In the case that the data feed is a Beacon set, the\n /// details should be the ABI-encoded Airnode addresses array and template\n /// IDs array.\n /// @param dataFeedDetails Data feed details\n /// @return dataFeedId Data feed ID\n function registerDataFeed(\n bytes calldata dataFeedDetails\n ) external override returns (bytes32 dataFeedId) {\n uint256 dataFeedDetailsLength = dataFeedDetails.length;\n if (\n dataFeedDetailsLength == DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\n ) {\n // dataFeedId maps to a Beacon\n (address airnode, bytes32 templateId) = abi.decode(\n dataFeedDetails,\n (address, bytes32)\n );\n require(airnode != address(0), \"Airnode address zero\");\n dataFeedId = deriveBeaconId(airnode, templateId);\n } else if (\n dataFeedDetailsLength >=\n DATA_FEED_DETAILS_LENGTH_FOR_BEACON_SET_WITH_TWO_BEACONS\n ) {\n require(\n dataFeedDetailsLength <= MAXIMUM_DATA_FEED_DETAILS_LENGTH,\n \"Data feed details too long\"\n );\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\n .decode(dataFeedDetails, (address[], bytes32[]));\n require(\n abi.encode(airnodes, templateIds).length ==\n dataFeedDetailsLength,\n \"Data feed details trail\"\n );\n uint256 beaconCount = airnodes.length;\n require(\n beaconCount == templateIds.length,\n \"Parameter length mismatch\"\n );\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\n for (uint256 ind = 0; ind < beaconCount; ind++) {\n require(airnodes[ind] != address(0), \"Airnode address zero\");\n beaconIds[ind] = deriveBeaconId(\n airnodes[ind],\n templateIds[ind]\n );\n }\n dataFeedId = deriveBeaconSetId(beaconIds);\n } else {\n revert(\"Data feed details too short\");\n }\n if (dataFeedIdToDetails[dataFeedId].length != dataFeedDetailsLength) {\n dataFeedIdToDetails[dataFeedId] = dataFeedDetails;\n emit RegisteredDataFeed(dataFeedId, dataFeedDetails);\n }\n }\n\n /// @notice In an imaginary array consisting of the the active data feed\n /// IDs and active dAPI names, picks the index-th identifier, and returns\n /// all data about the respective data feed that is available. Whenever\n /// data is not available (including the case where index does not\n /// correspond to an active data feed), returns empty values.\n /// @dev Airseeker uses this function to get all the data it needs about an\n /// active data feed with a single RPC call\n /// @param index Index\n /// @return dataFeedId Data feed ID\n /// @return dapiName dAPI name (`bytes32(0)` if the active data feed is\n /// identified by a data feed ID)\n /// @return dataFeedDetails Data feed details\n /// @return dataFeedValue Data feed value read from Api3ServerV1\n /// @return dataFeedTimestamp Data feed timestamp read from Api3ServerV1\n /// @return beaconValues Beacon values read from Api3ServerV1\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\n /// @return updateParameters Update parameters\n /// @return signedApiUrls Signed API URLs of the Beacon Airnodes\n function activeDataFeed(\n uint256 index\n )\n external\n view\n override\n returns (\n bytes32 dataFeedId,\n bytes32 dapiName,\n bytes memory dataFeedDetails,\n int224 dataFeedValue,\n uint32 dataFeedTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps,\n bytes memory updateParameters,\n string[] memory signedApiUrls\n )\n {\n uint256 activeDataFeedIdsLength = activeDataFeedIdCount();\n if (index < activeDataFeedIdsLength) {\n dataFeedId = activeDataFeedIds.at(index);\n updateParameters = dataFeedIdToUpdateParameters(dataFeedId);\n } else if (index < activeDataFeedIdsLength + activeDapiNames.length()) {\n dapiName = activeDapiNames.at(index - activeDataFeedIdsLength);\n dataFeedId = IApi3ServerV1(api3ServerV1).dapiNameHashToDataFeedId(\n keccak256(abi.encodePacked(dapiName))\n );\n updateParameters = dapiNameToUpdateParameters(dapiName);\n }\n if (dataFeedId != bytes32(0)) {\n dataFeedDetails = dataFeedIdToDetails[dataFeedId];\n (dataFeedValue, dataFeedTimestamp) = IApi3ServerV1(api3ServerV1)\n .dataFeeds(dataFeedId);\n }\n if (dataFeedDetails.length != 0) {\n if (\n dataFeedDetails.length ==\n DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\n ) {\n beaconValues = new int224[](1);\n beaconTimestamps = new uint32[](1);\n signedApiUrls = new string[](1);\n (address airnode, bytes32 templateId) = abi.decode(\n dataFeedDetails,\n (address, bytes32)\n );\n (beaconValues[0], beaconTimestamps[0]) = IApi3ServerV1(\n api3ServerV1\n ).dataFeeds(deriveBeaconId(airnode, templateId));\n signedApiUrls[0] = airnodeToSignedApiUrl[airnode];\n } else {\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\n .decode(dataFeedDetails, (address[], bytes32[]));\n uint256 beaconCount = airnodes.length;\n beaconValues = new int224[](beaconCount);\n beaconTimestamps = new uint32[](beaconCount);\n signedApiUrls = new string[](beaconCount);\n for (uint256 ind = 0; ind < beaconCount; ind++) {\n (beaconValues[ind], beaconTimestamps[ind]) = IApi3ServerV1(\n api3ServerV1\n ).dataFeeds(\n deriveBeaconId(airnodes[ind], templateIds[ind])\n );\n signedApiUrls[ind] = airnodeToSignedApiUrl[airnodes[ind]];\n }\n }\n }\n }\n\n /// @notice Returns the number of active data feeds identified by a data\n /// feed ID or dAPI name\n /// @return Active data feed count\n function activeDataFeedCount() external view override returns (uint256) {\n return activeDataFeedIdCount() + activeDapiNameCount();\n }\n\n /// @notice Returns the number of active data feeds identified by a data\n /// feed ID\n /// @return Active data feed ID count\n function activeDataFeedIdCount() public view override returns (uint256) {\n return activeDataFeedIds.length();\n }\n\n /// @notice Returns the number of active data feeds identified by a dAPI\n /// name\n /// @return Active dAPI name count\n function activeDapiNameCount() public view override returns (uint256) {\n return activeDapiNames.length();\n }\n\n /// @notice Data feed ID to update parameters\n /// @param dataFeedId Data feed ID\n /// @return updateParameters Update parameters\n function dataFeedIdToUpdateParameters(\n bytes32 dataFeedId\n ) public view override returns (bytes memory updateParameters) {\n updateParameters = updateParametersHashToValue[\n dataFeedIdToUpdateParametersHash[dataFeedId]\n ];\n }\n\n /// @notice dAPI name to update parameters\n /// @param dapiName dAPI name\n /// @return updateParameters Update parameters\n function dapiNameToUpdateParameters(\n bytes32 dapiName\n ) public view override returns (bytes memory updateParameters) {\n updateParameters = updateParametersHashToValue[\n dapiNameToUpdateParametersHash[dapiName]\n ];\n }\n\n /// @notice Returns if the data feed with ID is registered\n /// @param dataFeedId Data feed ID\n /// @return If the data feed with ID is registered\n function dataFeedIsRegistered(\n bytes32 dataFeedId\n ) external view override returns (bool) {\n return dataFeedIdToDetails[dataFeedId].length != 0;\n }\n\n /// @notice Derives the Beacon ID from the Airnode address and template ID\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @return beaconId Beacon ID\n function deriveBeaconId(\n address airnode,\n bytes32 templateId\n ) private pure returns (bytes32 beaconId) {\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\n }\n\n /// @notice Derives the Beacon set ID from the Beacon IDs\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Beacon set ID\n function deriveBeaconSetId(\n bytes32[] memory beaconIds\n ) private pure returns (bytes32 beaconSetId) {\n beaconSetId = keccak256(abi.encode(beaconIds));\n }\n}\n" + }, + "contracts/api3-server-v1/Api3Market.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access/HashRegistry.sol\";\nimport \"../utils/ExtendedSelfMulticall.sol\";\nimport \"./interfaces/IApi3Market.sol\";\nimport \"./AirseekerRegistry.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.9.5/utils/math/SafeCast.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/MerkleProof.sol\";\nimport \"./interfaces/IApi3ServerV1.sol\";\nimport \"./proxies/interfaces/IProxyFactory.sol\";\n\n/// @title The contract that API3 users interact with using the API3 Market\n/// frontend to purchase data feed subscriptions\n/// @notice API3 aims to streamline and protocolize its integration processes\n/// through the API3 Market (https://market.api3.org), which is a data feed\n/// subscription marketplace. The Api3Market contract is the on-chain portion\n/// of this system.\n/// Api3Market enables API3 to predetermine the decisions related to its data\n/// feed services (such as the curation of data feed sources or subscription\n/// prices) and publish them on-chain. This streamlines the intergation flow,\n/// as it allows the users to initiate subscriptions immediately, without\n/// requiring any two-way communication with API3. Furthermore, this removes\n/// the need for API3 to have agents operating in the meatspace gathering order\n/// details, quoting prices and reviewing payments, and allows all such\n/// operations to be cryptographically secured with a multi-party scheme in an\n/// end-to-end manner.\n/// @dev The user is strongly recommended to use the API3 Market frontend while\n/// interacting with this contract, mostly because doing so successfully\n/// requires some amount of knowledge of other API3 contracts. Specifically,\n/// Api3Market requires the data feed for which the subscription is being\n/// purchased to be \"readied\", the correct Merkle proofs to be provided, and\n/// enough payment to be made. The API3 Market frontend will fetch the\n/// appropriate Merkle proofs, create a multicall transaction that will ready\n/// the data feed before making the call to buy the subscription, and compute\n/// the amount to be sent that will barely allow the subscription to be\n/// purchased. For most users, building such a transaction themselves would be\n/// too impractical.\ncontract Api3Market is HashRegistry, ExtendedSelfMulticall, IApi3Market {\n enum UpdateParametersComparisonResult {\n EqualToQueued,\n BetterThanQueued,\n WorseThanQueued\n }\n\n // The update parameters for each subscription is kept in a hash map rather\n // than in full form as an optimization. Refer to AirseekerRegistry for a\n // similar scheme.\n // The subscription queues are kept as linked lists, for which each\n // subscription has a next subscription ID field.\n struct Subscription {\n bytes32 updateParametersHash;\n uint32 endTimestamp;\n uint224 dailyPrice;\n bytes32 nextSubscriptionId;\n }\n\n /// @notice Maximum subscription queue length for a dAPI\n /// @dev Some functionality in this contract requires to iterate through\n /// the entire subscription queue for a dAPI, and the queue length is\n /// limited to prevent this process from being bloated. Considering that\n /// each item in the subscription queue has unique update parameters, the\n /// length of the subscription queue is also limited by the number of\n /// unique update parameters offered in the dAPI pricing Merkle tree. For\n /// reference, at the time this contract is implemented, the API3 Market\n /// offers 4 update parameter options, and this number is not expected to\n /// be increased (i.e., we do not expect this queue length limit to be hit\n /// in practice).\n uint256 public constant override MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH = 5;\n\n /// @notice dAPI management Merkle root hash type\n /// @dev \"Hash type\" is what HashRegistry uses to address hashes used for\n /// different purposes\n bytes32 public constant override DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE =\n keccak256(abi.encodePacked(\"dAPI management Merkle root\"));\n\n /// @notice dAPI pricing Merkle root hash type\n bytes32 public constant override DAPI_PRICING_MERKLE_ROOT_HASH_TYPE =\n keccak256(abi.encodePacked(\"dAPI pricing Merkle root\"));\n\n /// @notice Signed API URL Merkle root hash type\n bytes32 public constant override SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE =\n keccak256(abi.encodePacked(\"Signed API URL Merkle root\"));\n\n /// @notice Maximum dAPI update age. This contract cannot be used to set a\n /// dAPI name to a data feed that has not been updated in the last\n /// `MAXIMUM_DAPI_UPDATE_AGE`.\n uint256 public constant override MAXIMUM_DAPI_UPDATE_AGE = 1 days;\n\n /// @notice Api3ServerV1 contract address\n address public immutable override api3ServerV1;\n\n /// @notice ProxyFactory contract address\n address public immutable override proxyFactory;\n\n /// @notice AirseekerRegistry contract address\n address public immutable override airseekerRegistry;\n\n /// @notice Subscriptions indexed by their IDs\n mapping(bytes32 => Subscription) public override subscriptions;\n\n /// @notice dAPI name to current subscription ID, which denotes the start\n /// of the subscription queue for the dAPI\n mapping(bytes32 => bytes32) public override dapiNameToCurrentSubscriptionId;\n\n // Update parameters hash map\n mapping(bytes32 => bytes) private updateParametersHashToValue;\n\n // Length of abi.encode(address, bytes32)\n uint256 private constant DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON =\n 32 + 32;\n\n // Length of abi.encode(uint256, int224, uint256)\n uint256 private constant UPDATE_PARAMETERS_LENGTH = 32 + 32 + 32;\n\n /// @dev Api3Market deploys its own AirseekerRegistry deterministically.\n /// This implies that Api3Market-specific Airseekers should be operated by\n /// pointing at this contract.\n /// @param owner_ Owner address\n /// @param proxyFactory_ ProxyFactory contract address\n constructor(address owner_, address proxyFactory_) HashRegistry(owner_) {\n proxyFactory = proxyFactory_;\n address api3ServerV1_ = IProxyFactory(proxyFactory_).api3ServerV1();\n api3ServerV1 = api3ServerV1_;\n airseekerRegistry = address(\n new AirseekerRegistry{salt: bytes32(0)}(\n address(this),\n api3ServerV1_\n )\n );\n }\n\n /// @notice Returns the owner address\n /// @return Owner address\n function owner()\n public\n view\n override(HashRegistry, IOwnable)\n returns (address)\n {\n return super.owner();\n }\n\n /// @notice Overriden to be disabled\n function renounceOwnership() public pure override(HashRegistry, IOwnable) {\n revert(\"Ownership cannot be renounced\");\n }\n\n /// @notice Overriden to be disabled\n function transferOwnership(\n address\n ) public pure override(HashRegistry, IOwnable) {\n revert(\"Ownership cannot be transferred\");\n }\n\n /// @notice Buys subscription and updates the current subscription ID if\n /// necessary. The user is recommended to interact with this contract only\n /// over the API3 Market frontend due to its complexity.\n /// @dev The data feed that the dAPI name will be set to after this\n /// function is called must be readied (see `validateDataFeedReadiness()`)\n /// before calling this function.\n /// Enough funds must be sent to put the sponsor wallet balance over its\n /// expected amount after the subscription is bought. Since sponsor wallets\n /// send data feed update transactions, it is not possible to estimate what\n /// their balance will be at the time sent transactions are confirmed. To\n /// avoid transactions being reverted as a result of this, consider sending\n /// some extra.\n /// @param dapiName dAPI name\n /// @param dataFeedId Data feed ID\n /// @param sponsorWallet Sponsor wallet address\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\n /// and proof\n /// @param updateParameters Update parameters\n /// @param duration Subscription duration\n /// @param price Subscription price\n /// @param dapiPricingMerkleData ABI-encoded dAPI pricing Merkle root and\n /// proof\n /// @return subscriptionId Subscription ID\n function buySubscription(\n bytes32 dapiName,\n bytes32 dataFeedId,\n address payable sponsorWallet,\n bytes calldata dapiManagementMerkleData,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price,\n bytes calldata dapiPricingMerkleData\n ) external payable override returns (bytes32 subscriptionId) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n require(sponsorWallet != address(0), \"Sponsor wallet address zero\");\n verifyDapiManagementMerkleProof(\n dapiName,\n dataFeedId,\n sponsorWallet,\n dapiManagementMerkleData\n );\n verifyDapiPricingMerkleProof(\n dapiName,\n updateParameters,\n duration,\n price,\n dapiPricingMerkleData\n );\n subscriptionId = addSubscriptionToQueue(\n dapiName,\n dataFeedId,\n updateParameters,\n duration,\n price\n );\n require(\n sponsorWallet.balance + msg.value >=\n computeExpectedSponsorWalletBalance(dapiName),\n \"Insufficient payment\"\n );\n emit BoughtSubscription(\n dapiName,\n subscriptionId,\n dataFeedId,\n sponsorWallet,\n updateParameters,\n duration,\n price,\n msg.value\n );\n if (msg.value > 0) {\n (bool success, ) = sponsorWallet.call{value: msg.value}(\"\");\n require(success, \"Transfer unsuccessful\");\n }\n }\n\n /// @notice If the current subscription has ended, updates it with the one\n /// that will end next\n /// @dev The fact that there is a current subscription that has ended would\n /// mean that API3 is providing a service that was not paid for. Therefore,\n /// API3 should poll this function for all active dAPI names and call it\n /// whenever it is not going to revert to downgrade the specs.\n /// @param dapiName dAPI name\n function updateCurrentSubscriptionId(bytes32 dapiName) public override {\n bytes32 currentSubscriptionId = dapiNameToCurrentSubscriptionId[\n dapiName\n ];\n require(\n currentSubscriptionId != bytes32(0),\n \"Subscription queue empty\"\n );\n require(\n subscriptions[currentSubscriptionId].endTimestamp <=\n block.timestamp,\n \"Current subscription not ended\"\n );\n updateEndedCurrentSubscriptionId(dapiName, currentSubscriptionId);\n }\n\n /// @notice Updates the dAPI name to match the respective Merkle leaf\n /// @dev Buying a dAPI subscription always updates the dAPI name if\n /// necessary. However, API3 may also publish new Merkle roots between\n /// subscription purchases, in which case API3 should call this function to\n /// bring the chain state up to date. Therefore, API3 should poll this\n /// function for all active dAPI names and call it whenever it will not\n /// revert.\n /// Similar to `buySubscription()`, this function requires the data feed\n /// that the dAPI will be pointed to to be readied.\n /// This function is allowed to be called even when the respective dAPI is\n /// not active, which means that a dAPI name being set does not imply that\n /// the respective data feed is in service. Users should only use dAPIs for\n /// which there is an active subscription with the update parameters that\n /// satisfy their needs.\n /// @param dapiName dAPI name\n /// @param dataFeedId Data feed ID\n /// @param sponsorWallet Sponsor wallet address\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\n /// and proof\n function updateDapiName(\n bytes32 dapiName,\n bytes32 dataFeedId,\n address sponsorWallet,\n bytes calldata dapiManagementMerkleData\n ) external override {\n if (dataFeedId != bytes32(0)) {\n require(sponsorWallet != address(0), \"Sponsor wallet address zero\");\n } else {\n require(\n sponsorWallet == address(0),\n \"Sponsor wallet address not zero\"\n );\n }\n verifyDapiManagementMerkleProof(\n dapiName,\n dataFeedId,\n sponsorWallet,\n dapiManagementMerkleData\n );\n bytes32 currentDataFeedId = IApi3ServerV1(api3ServerV1)\n .dapiNameHashToDataFeedId(keccak256(abi.encodePacked(dapiName)));\n require(currentDataFeedId != dataFeedId, \"Does not update dAPI name\");\n if (dataFeedId != bytes32(0)) {\n validateDataFeedReadiness(dataFeedId);\n }\n IApi3ServerV1(api3ServerV1).setDapiName(dapiName, dataFeedId);\n }\n\n /// @notice Updates the signed API URL of the Airnode to match the\n /// respective Merkle leaf\n /// @dev Unlike the dAPI management and pricing Merkle leaves, the signed\n /// API URL Merkle leaves are not registered by the users as a part of\n /// subscription purchase transactions. API3 should poll this function for\n /// all Airnodes that are used in active dAPIs and call it whenever it will\n /// not revert.\n /// @param airnode Airnode address\n /// @param signedApiUrl Signed API URL\n /// @param signedApiUrlMerkleData ABI-encoded signed API URL Merkle root\n /// and proof\n function updateSignedApiUrl(\n address airnode,\n string calldata signedApiUrl,\n bytes calldata signedApiUrlMerkleData\n ) external override {\n verifySignedApiUrlMerkleProof(\n airnode,\n signedApiUrl,\n signedApiUrlMerkleData\n );\n require(\n keccak256(abi.encodePacked(signedApiUrl)) !=\n keccak256(\n abi.encodePacked(\n AirseekerRegistry(airseekerRegistry)\n .airnodeToSignedApiUrl(airnode)\n )\n ),\n \"Does not update signed API URL\"\n );\n AirseekerRegistry(airseekerRegistry).setSignedApiUrl(\n airnode,\n signedApiUrl\n );\n }\n\n /// @notice Calls Api3ServerV1 to update the Beacon using data signed by\n /// the Airnode\n /// @dev The user is intended to make a multicall transaction through the\n /// API3 Market frontend to satisfy the required conditions to be able to\n /// buy a subscription and buy the subscription in a single transaction.\n /// The functions to which external calls must be made to to satisfy said\n /// conditions (such as this one) are added to this contract so that they\n /// can be multi-called by the user.\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param timestamp Signature timestamp\n /// @param data Update data (an `int256` encoded in contract ABI)\n /// @param signature Template ID, timestamp and the update data signed by\n /// the Airnode\n /// @return beaconId Updated Beacon ID\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override returns (bytes32 beaconId) {\n return\n IApi3ServerV1(api3ServerV1).updateBeaconWithSignedData(\n airnode,\n templateId,\n timestamp,\n data,\n signature\n );\n }\n\n /// @notice Calls Api3ServerV1 to update the Beacon set using the current\n /// values of its Beacons\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Updated Beacon set ID\n function updateBeaconSetWithBeacons(\n bytes32[] calldata beaconIds\n ) external override returns (bytes32 beaconSetId) {\n return\n IApi3ServerV1(api3ServerV1).updateBeaconSetWithBeacons(beaconIds);\n }\n\n /// @notice Calls ProxyFactory to deterministically deploy the dAPI proxy\n /// @dev It is recommended for the users to read data feeds through proxies\n /// deployed by ProxyFactory, rather than calling Api3ServerV1 directly.\n /// Even though proxy deployment is not a condition for purchasing\n /// subscriptions, the interface is implemented here to allow the user to\n /// purchase a dAPI subscription and deploy the respective proxy in the\n /// same transaction with a multicall.\n /// @param dapiName dAPI name\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n proxyAddress = IProxyFactory(proxyFactory).deployDapiProxy(\n dapiName,\n metadata\n );\n }\n\n /// @notice Calls ProxyFactory to deterministically deploy the dAPI proxy\n /// with OEV support\n /// @param dapiName dAPI name\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n proxyAddress = IProxyFactory(proxyFactory).deployDapiProxyWithOev(\n dapiName,\n oevBeneficiary,\n metadata\n );\n }\n\n /// @notice Calls AirseekerRegistry to register the data feed\n /// @param dataFeedDetails Data feed details\n /// @return dataFeedId Data feed ID\n function registerDataFeed(\n bytes calldata dataFeedDetails\n ) external override returns (bytes32 dataFeedId) {\n dataFeedId = AirseekerRegistry(airseekerRegistry).registerDataFeed(\n dataFeedDetails\n );\n }\n\n /// @notice Computes the expected sponsor wallet balance based on the\n /// current subscription queue\n /// @dev API3 estimates the transaction fee cost of subscriptions, and\n /// prices them accordingly. The subscription fees paid for a dAPI are sent\n /// to the respective sponsor wallet, which will send the update\n /// transactions. In the case that a subscription is overpriced, the extra\n /// funds are automatically rolled over as a discount to the next\n /// subscription bought for the same dAPI. In the case that a subscription\n /// is underpriced, there is a risk of the sponsor wallet running out of\n /// funds, resulting in the subscription specs to not be met. To avoid\n /// this, API3 should poll this function for all active dAPI names, check\n /// the respective sponsor wallet balances, and top up the sponsor wallets\n /// as necessary. The conditions that result in the underpricing will most\n /// likely require an updated dAPI pricing Merkle root to be published.\n /// @param dapiName dAPI name\n /// @return expectedSponsorWalletBalance Expected sponsor wallet balance\n function computeExpectedSponsorWalletBalance(\n bytes32 dapiName\n ) public view override returns (uint256 expectedSponsorWalletBalance) {\n uint32 startTimestamp = SafeCast.toUint32(block.timestamp);\n Subscription storage queuedSubscription;\n for (\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\n dapiName\n ];\n queuedSubscriptionId != bytes32(0);\n queuedSubscriptionId = queuedSubscription.nextSubscriptionId\n ) {\n queuedSubscription = subscriptions[queuedSubscriptionId];\n uint32 endTimestamp = queuedSubscription.endTimestamp;\n if (endTimestamp > block.timestamp) {\n expectedSponsorWalletBalance +=\n ((endTimestamp - startTimestamp) *\n queuedSubscription.dailyPrice) /\n 1 days;\n startTimestamp = endTimestamp;\n }\n }\n }\n\n /// @notice Computes the expected sponsor wallet balance after the\n /// respective subscription is added to the queue\n /// @dev This function is intended to be used by the API3 Market frontend\n /// to calculate how much the user should pay to purchase a specific\n /// subscription. As mentioned in the `buySubscription()` docstring, the\n /// user should aim for the sponsor wallet balance to be slightly more than\n /// the required amount in case it sends a transaction in the meantime,\n /// whose gas cost may decrease the sponsor wallet balance unexpectedly.\n /// Unit prices of the queued subscriptions are recorded on a daily basis\n /// and the expected balance is computed from these, which introduces a\n /// rounding error in the order of Weis. This also applies in practice (in\n /// that one can buy a subscription whose price is 1 ETH at 0.999... ETH).\n /// This behavior is accepted due to being trivial in effect.\n /// @param dapiName dAPI name\n /// @param updateParameters Update parameters\n /// @param duration Subscription duration\n /// @param price Subscription price\n /// @return expectedSponsorWalletBalance Expected sponsor wallet balance\n function computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(\n bytes32 dapiName,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price\n ) external view override returns (uint256 expectedSponsorWalletBalance) {\n require(\n updateParameters.length == UPDATE_PARAMETERS_LENGTH,\n \"Update parameters length invalid\"\n );\n (\n bytes32 subscriptionId,\n uint32 endTimestamp,\n bytes32 previousSubscriptionId,\n bytes32 nextSubscriptionId\n ) = prospectSubscriptionPositionInQueue(\n dapiName,\n updateParameters,\n duration\n );\n uint256 dailyPrice = (price * 1 days) / duration;\n uint32 startTimestamp = SafeCast.toUint32(block.timestamp);\n bytes32 queuedSubscriptionId = previousSubscriptionId == bytes32(0)\n ? subscriptionId\n : dapiNameToCurrentSubscriptionId[dapiName];\n for (; queuedSubscriptionId != bytes32(0); ) {\n if (queuedSubscriptionId == subscriptionId) {\n expectedSponsorWalletBalance +=\n ((endTimestamp - startTimestamp) * dailyPrice) /\n 1 days;\n startTimestamp = endTimestamp;\n queuedSubscriptionId = nextSubscriptionId;\n } else {\n Subscription storage queuedSubscription = subscriptions[\n queuedSubscriptionId\n ];\n uint32 queuedSubscriptionEndTimestamp = queuedSubscription\n .endTimestamp;\n if (queuedSubscriptionEndTimestamp > block.timestamp) {\n expectedSponsorWalletBalance +=\n ((queuedSubscriptionEndTimestamp - startTimestamp) *\n queuedSubscription.dailyPrice) /\n 1 days;\n startTimestamp = queuedSubscriptionEndTimestamp;\n }\n if (previousSubscriptionId == queuedSubscriptionId) {\n queuedSubscriptionId = subscriptionId;\n } else {\n queuedSubscriptionId = queuedSubscription\n .nextSubscriptionId;\n }\n }\n }\n }\n\n /// @notice Gets all data about the dAPI that is available\n /// @dev This function is intended to be used by the API3 Market frontend\n /// to get all data related to a specific dAPI. It returns the entire\n /// subscription queue, including the items whose end timestamps are in the\n /// past.\n /// @param dapiName dAPI name\n /// @return dataFeedDetails Data feed details\n /// @return dapiValue dAPI value read from Api3ServerV1\n /// @return dapiTimestamp dAPI timestamp read from Api3ServerV1\n /// @return beaconValues Beacon values read from Api3ServerV1\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\n /// @return updateParameters Update parameters of the subscriptions in the\n /// queue\n /// @return endTimestamps End timestamps of the subscriptions in the queue\n /// @return dailyPrices Daily prices of the subscriptions in the queue\n function getDapiData(\n bytes32 dapiName\n )\n external\n view\n override\n returns (\n bytes memory dataFeedDetails,\n int224 dapiValue,\n uint32 dapiTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps,\n bytes[] memory updateParameters,\n uint32[] memory endTimestamps,\n uint224[] memory dailyPrices\n )\n {\n bytes32 currentDataFeedId = IApi3ServerV1(api3ServerV1)\n .dapiNameHashToDataFeedId(keccak256(abi.encodePacked(dapiName)));\n (\n dataFeedDetails,\n dapiValue,\n dapiTimestamp,\n beaconValues,\n beaconTimestamps\n ) = getDataFeedData(currentDataFeedId);\n uint256 queueLength = 0;\n for (\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\n dapiName\n ];\n queuedSubscriptionId != bytes32(0);\n queuedSubscriptionId = subscriptions[queuedSubscriptionId]\n .nextSubscriptionId\n ) {\n queueLength++;\n }\n updateParameters = new bytes[](queueLength);\n endTimestamps = new uint32[](queueLength);\n dailyPrices = new uint224[](queueLength);\n Subscription storage queuedSubscription = subscriptions[\n dapiNameToCurrentSubscriptionId[dapiName]\n ];\n for (uint256 ind = 0; ind < queueLength; ind++) {\n updateParameters[ind] = updateParametersHashToValue[\n queuedSubscription.updateParametersHash\n ];\n endTimestamps[ind] = queuedSubscription.endTimestamp;\n dailyPrices[ind] = queuedSubscription.dailyPrice;\n queuedSubscription = subscriptions[\n queuedSubscription.nextSubscriptionId\n ];\n }\n }\n\n /// @notice Gets all data about the data feed that is available\n /// @dev This function is intended to be used by the API3 Market frontend\n /// to determine what needs to be done to ready the data feed to purchase\n /// the respective subscription.\n /// @param dataFeedId Data feed ID\n /// @return dataFeedDetails Data feed details\n /// @return dataFeedValue Data feed value read from Api3ServerV1\n /// @return dataFeedTimestamp Data feed timestamp read from Api3ServerV1\n /// @return beaconValues Beacon values read from Api3ServerV1\n /// @return beaconTimestamps Beacon timestamps read from Api3ServerV1\n function getDataFeedData(\n bytes32 dataFeedId\n )\n public\n view\n returns (\n bytes memory dataFeedDetails,\n int224 dataFeedValue,\n uint32 dataFeedTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps\n )\n {\n dataFeedDetails = AirseekerRegistry(airseekerRegistry)\n .dataFeedIdToDetails(dataFeedId);\n (dataFeedValue, dataFeedTimestamp) = IApi3ServerV1(api3ServerV1)\n .dataFeeds(dataFeedId);\n if (\n dataFeedDetails.length == DATA_FEED_DETAILS_LENGTH_FOR_SINGLE_BEACON\n ) {\n beaconValues = new int224[](1);\n beaconTimestamps = new uint32[](1);\n (address airnode, bytes32 templateId) = abi.decode(\n dataFeedDetails,\n (address, bytes32)\n );\n (beaconValues[0], beaconTimestamps[0]) = IApi3ServerV1(api3ServerV1)\n .dataFeeds(deriveBeaconId(airnode, templateId));\n } else {\n (address[] memory airnodes, bytes32[] memory templateIds) = abi\n .decode(dataFeedDetails, (address[], bytes32[]));\n uint256 beaconCount = airnodes.length;\n beaconValues = new int224[](beaconCount);\n beaconTimestamps = new uint32[](beaconCount);\n for (uint256 ind = 0; ind < beaconCount; ind++) {\n (beaconValues[ind], beaconTimestamps[ind]) = IApi3ServerV1(\n api3ServerV1\n ).dataFeeds(deriveBeaconId(airnodes[ind], templateIds[ind]));\n }\n }\n }\n\n /// @notice Subscription ID to update parameters\n /// @param subscriptionId Subscription ID\n /// @return updateParameters Update parameters\n function subscriptionIdToUpdateParameters(\n bytes32 subscriptionId\n ) public view override returns (bytes memory updateParameters) {\n updateParameters = updateParametersHashToValue[\n subscriptions[subscriptionId].updateParametersHash\n ];\n }\n\n /// @notice Returns the signature delegation hash type used in delegation\n /// signatures\n /// @return Signature delegation hash type\n function signatureDelegationHashType()\n public\n view\n virtual\n override(HashRegistry, IHashRegistry)\n returns (bytes32)\n {\n return keccak256(abi.encodePacked(\"Api3Market signature delegation\"));\n }\n\n /// @notice Adds the subscription to the queue if applicable\n /// @param dapiName dAPI name\n /// @param dataFeedId Data feed ID\n /// @param updateParameters Update parameters\n /// @param duration Subscription duration\n /// @param price Subscription price\n function addSubscriptionToQueue(\n bytes32 dapiName,\n bytes32 dataFeedId,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price\n ) private returns (bytes32 subscriptionId) {\n uint32 endTimestamp;\n bytes32 previousSubscriptionId;\n bytes32 nextSubscriptionId;\n (\n subscriptionId,\n endTimestamp,\n previousSubscriptionId,\n nextSubscriptionId\n ) = prospectSubscriptionPositionInQueue(\n dapiName,\n updateParameters,\n duration\n );\n bytes32 updateParametersHash = keccak256(updateParameters);\n if (updateParametersHashToValue[updateParametersHash].length == 0) {\n updateParametersHashToValue[\n updateParametersHash\n ] = updateParameters;\n }\n subscriptions[subscriptionId] = Subscription({\n updateParametersHash: updateParametersHash,\n endTimestamp: endTimestamp,\n dailyPrice: SafeCast.toUint224((price * 1 days) / duration),\n nextSubscriptionId: nextSubscriptionId\n });\n if (previousSubscriptionId == bytes32(0)) {\n if (subscriptionId != dapiNameToCurrentSubscriptionId[dapiName]) {\n emit UpdatedCurrentSubscriptionId(dapiName, subscriptionId);\n dapiNameToCurrentSubscriptionId[dapiName] = subscriptionId;\n }\n AirseekerRegistry(airseekerRegistry).setDapiNameUpdateParameters(\n dapiName,\n updateParameters\n );\n AirseekerRegistry(airseekerRegistry).setDapiNameToBeActivated(\n dapiName\n );\n } else {\n subscriptions[previousSubscriptionId]\n .nextSubscriptionId = subscriptionId;\n bytes32 currentSubscriptionId = dapiNameToCurrentSubscriptionId[\n dapiName\n ];\n if (\n subscriptions[currentSubscriptionId].endTimestamp <=\n block.timestamp\n ) {\n updateEndedCurrentSubscriptionId(\n dapiName,\n currentSubscriptionId\n );\n }\n }\n validateDataFeedReadiness(dataFeedId);\n if (\n IApi3ServerV1(api3ServerV1).dapiNameHashToDataFeedId(\n keccak256(abi.encodePacked(dapiName))\n ) != dataFeedId\n ) {\n IApi3ServerV1(api3ServerV1).setDapiName(dapiName, dataFeedId);\n }\n }\n\n /// @notice Updates the current subscription that has ended with the one\n /// that will end next\n /// @param dapiName dAPI name\n /// @param currentSubscriptionId Current subscription ID\n function updateEndedCurrentSubscriptionId(\n bytes32 dapiName,\n bytes32 currentSubscriptionId\n ) private {\n do {\n currentSubscriptionId = subscriptions[currentSubscriptionId]\n .nextSubscriptionId;\n } while (\n currentSubscriptionId != bytes32(0) &&\n subscriptions[currentSubscriptionId].endTimestamp <=\n block.timestamp\n );\n emit UpdatedCurrentSubscriptionId(dapiName, currentSubscriptionId);\n dapiNameToCurrentSubscriptionId[dapiName] = currentSubscriptionId;\n if (currentSubscriptionId == bytes32(0)) {\n AirseekerRegistry(airseekerRegistry).setDapiNameToBeDeactivated(\n dapiName\n );\n } else {\n AirseekerRegistry(airseekerRegistry).setDapiNameUpdateParameters(\n dapiName,\n subscriptionIdToUpdateParameters(currentSubscriptionId)\n );\n }\n }\n\n /// @notice Prospects the subscription position in the queue. It iterates\n /// through the entire subscription queue, which is implemented as a linked\n /// list, and returns the previous and next nodes of the subscription to be\n /// added.\n /// It reverts if no suitable position can be found, which would be because\n /// the addition of the subscription to the queue does not upgrade its\n /// specs unambiguously or addition of it results in the maximum queue\n /// length to be exceeded.\n /// @param dapiName dAPI name\n /// @param updateParameters Update parameters\n /// @param duration Subscription duration\n /// @return subscriptionId Subscription ID\n /// @return endTimestamp End timestamp\n /// @return previousSubscriptionId Previous subscription ID\n /// @return nextSubscriptionId Next subscription ID\n function prospectSubscriptionPositionInQueue(\n bytes32 dapiName,\n bytes calldata updateParameters,\n uint256 duration\n )\n private\n view\n returns (\n bytes32 subscriptionId,\n uint32 endTimestamp,\n bytes32 previousSubscriptionId,\n bytes32 nextSubscriptionId\n )\n {\n subscriptionId = keccak256(\n abi.encodePacked(dapiName, keccak256(updateParameters))\n );\n endTimestamp = SafeCast.toUint32(block.timestamp + duration);\n (\n uint256 deviationThresholdInPercentage,\n int224 deviationReference,\n uint256 heartbeatInterval\n ) = abi.decode(updateParameters, (uint256, int224, uint256));\n uint256 newQueueLength = 0;\n Subscription storage queuedSubscription;\n for (\n bytes32 queuedSubscriptionId = dapiNameToCurrentSubscriptionId[\n dapiName\n ];\n queuedSubscriptionId != bytes32(0);\n queuedSubscriptionId = queuedSubscription.nextSubscriptionId\n ) {\n queuedSubscription = subscriptions[queuedSubscriptionId];\n UpdateParametersComparisonResult updateParametersComparisonResult = compareUpdateParametersWithQueued(\n deviationThresholdInPercentage,\n deviationReference,\n heartbeatInterval,\n queuedSubscription.updateParametersHash\n );\n uint32 queuedSubscriptionEndTimestamp = queuedSubscription\n .endTimestamp;\n require(\n updateParametersComparisonResult ==\n UpdateParametersComparisonResult.BetterThanQueued ||\n endTimestamp > queuedSubscriptionEndTimestamp,\n \"Subscription does not upgrade\"\n );\n if (\n updateParametersComparisonResult ==\n UpdateParametersComparisonResult.WorseThanQueued &&\n queuedSubscriptionEndTimestamp > block.timestamp\n ) {\n previousSubscriptionId = queuedSubscriptionId;\n newQueueLength++;\n }\n if (\n updateParametersComparisonResult ==\n UpdateParametersComparisonResult.BetterThanQueued &&\n endTimestamp < queuedSubscriptionEndTimestamp\n ) {\n nextSubscriptionId = queuedSubscriptionId;\n for (\n ;\n queuedSubscriptionId != bytes32(0);\n queuedSubscriptionId = subscriptions[queuedSubscriptionId]\n .nextSubscriptionId\n ) {\n newQueueLength++;\n }\n break;\n }\n }\n require(\n newQueueLength < MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH,\n \"Subscription queue full\"\n );\n }\n\n /// @notice Compares the update parameters with the ones that belong to a\n /// queued subscription\n /// @param deviationThresholdInPercentage Deviation threshold in percentage\n /// @param deviationReference Deviation reference\n /// @param heartbeatInterval Heartbeat interval\n /// @param queuedUpdateParametersHash Queued update parameters hash\n /// @return Update parameters comparison result\n function compareUpdateParametersWithQueued(\n uint256 deviationThresholdInPercentage,\n int224 deviationReference,\n uint256 heartbeatInterval,\n bytes32 queuedUpdateParametersHash\n ) private view returns (UpdateParametersComparisonResult) {\n // The update parameters that belong to a queued subscription are\n // guaranteed to have been stored in the hash map\n (\n uint256 queuedDeviationThresholdInPercentage,\n int224 queuedDeviationReference,\n uint256 queuedHeartbeatInterval\n ) = abi.decode(\n updateParametersHashToValue[queuedUpdateParametersHash],\n (uint256, int224, uint256)\n );\n require(\n deviationReference == queuedDeviationReference,\n \"Deviation references not equal\"\n );\n if (\n (deviationThresholdInPercentage ==\n queuedDeviationThresholdInPercentage) &&\n (heartbeatInterval == queuedHeartbeatInterval)\n ) {\n return UpdateParametersComparisonResult.EqualToQueued;\n } else if (\n (deviationThresholdInPercentage <=\n queuedDeviationThresholdInPercentage) &&\n (heartbeatInterval <= queuedHeartbeatInterval)\n ) {\n return UpdateParametersComparisonResult.BetterThanQueued;\n } else if (\n (deviationThresholdInPercentage >=\n queuedDeviationThresholdInPercentage) &&\n (heartbeatInterval >= queuedHeartbeatInterval)\n ) {\n return UpdateParametersComparisonResult.WorseThanQueued;\n } else {\n // This is hit when the set of parameters are superior to each\n // other in different aspects, in which case they should not be\n // allowed to be in the same queue\n revert(\"Update parameters incomparable\");\n }\n }\n\n /// @notice Validates the readiness of the data feed. The data feed must\n /// have been updated on Api3ServerV1 in the last `MAXIMUM_DAPI_UPDATE_AGE`\n /// and registered on AirseekerRegistry.\n /// @param dataFeedId Data feed ID\n function validateDataFeedReadiness(bytes32 dataFeedId) private view {\n (, uint32 timestamp) = IApi3ServerV1(api3ServerV1).dataFeeds(\n dataFeedId\n );\n require(\n block.timestamp <= timestamp + MAXIMUM_DAPI_UPDATE_AGE,\n \"Data feed value stale\"\n );\n require(\n AirseekerRegistry(airseekerRegistry).dataFeedIsRegistered(\n dataFeedId\n ),\n \"Data feed not registered\"\n );\n }\n\n /// @notice Verifies the dAPI management Merkle proof\n /// @param dapiName dAPI name\n /// @param dataFeedId Data feed ID\n /// @param sponsorWallet Sponsor wallet address\n /// @param dapiManagementMerkleData ABI-encoded dAPI management Merkle root\n /// and proof\n function verifyDapiManagementMerkleProof(\n bytes32 dapiName,\n bytes32 dataFeedId,\n address sponsorWallet,\n bytes calldata dapiManagementMerkleData\n ) private view {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n (\n bytes32 dapiManagementMerkleRoot,\n bytes32[] memory dapiManagementMerkleProof\n ) = abi.decode(dapiManagementMerkleData, (bytes32, bytes32[]));\n require(\n hashes[DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE].value ==\n dapiManagementMerkleRoot,\n \"Invalid root\"\n );\n require(\n MerkleProof.verify(\n dapiManagementMerkleProof,\n dapiManagementMerkleRoot,\n keccak256(\n bytes.concat(\n keccak256(\n abi.encode(dapiName, dataFeedId, sponsorWallet)\n )\n )\n )\n ),\n \"Invalid proof\"\n );\n }\n\n /// @notice Verifies the dAPI pricing Merkle proof\n /// @param dapiName dAPI name\n /// @param updateParameters Update parameters\n /// @param duration Subscription duration\n /// @param price Subscription price\n /// @param dapiPricingMerkleData ABI-encoded dAPI pricing Merkle root and\n /// proof\n function verifyDapiPricingMerkleProof(\n bytes32 dapiName,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price,\n bytes calldata dapiPricingMerkleData\n ) private view {\n require(\n updateParameters.length == UPDATE_PARAMETERS_LENGTH,\n \"Update parameters length invalid\"\n );\n require(duration != 0, \"Duration zero\");\n require(price != 0, \"Price zero\");\n (\n bytes32 dapiPricingMerkleRoot,\n bytes32[] memory dapiPricingMerkleProof\n ) = abi.decode(dapiPricingMerkleData, (bytes32, bytes32[]));\n require(\n hashes[DAPI_PRICING_MERKLE_ROOT_HASH_TYPE].value ==\n dapiPricingMerkleRoot,\n \"Invalid root\"\n );\n require(\n MerkleProof.verify(\n dapiPricingMerkleProof,\n dapiPricingMerkleRoot,\n keccak256(\n bytes.concat(\n keccak256(\n abi.encode(\n dapiName,\n block.chainid,\n updateParameters,\n duration,\n price\n )\n )\n )\n )\n ),\n \"Invalid proof\"\n );\n }\n\n /// @notice Verifies the signed API URL Merkle proof\n /// @param airnode Airnode address\n /// @param signedApiUrl Signed API URL\n /// @param signedApiUrlMerkleData ABI-encoded signed API URL Merkle root\n /// and proof\n function verifySignedApiUrlMerkleProof(\n address airnode,\n string calldata signedApiUrl,\n bytes calldata signedApiUrlMerkleData\n ) private view {\n (\n bytes32 signedApiUrlMerkleRoot,\n bytes32[] memory signedApiUrlMerkleProof\n ) = abi.decode(signedApiUrlMerkleData, (bytes32, bytes32[]));\n require(\n hashes[SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE].value ==\n signedApiUrlMerkleRoot,\n \"Invalid root\"\n );\n require(\n MerkleProof.verify(\n signedApiUrlMerkleProof,\n signedApiUrlMerkleRoot,\n keccak256(\n bytes.concat(keccak256(abi.encode(airnode, signedApiUrl)))\n )\n ),\n \"Invalid proof\"\n );\n }\n\n /// @notice Derives the Beacon ID from the Airnode address and template ID\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @return beaconId Beacon ID\n function deriveBeaconId(\n address airnode,\n bytes32 templateId\n ) private pure returns (bytes32 beaconId) {\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\n }\n}\n" + }, + "contracts/api3-server-v1/Api3ServerV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./OevDapiServer.sol\";\nimport \"./BeaconUpdatesWithSignedData.sol\";\nimport \"./interfaces/IApi3ServerV1.sol\";\n\n/// @title First version of the contract that API3 uses to serve data feeds\n/// @notice Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets,\n/// dAPIs, with optional OEV support for all of these.\n/// The base Beacons are only updateable using signed data, and the Beacon sets\n/// are updateable based on the Beacons, optionally using PSP. OEV proxy\n/// Beacons and Beacon sets are updateable using OEV-signed data.\n/// Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\ncontract Api3ServerV1 is\n OevDapiServer,\n BeaconUpdatesWithSignedData,\n IApi3ServerV1\n{\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n ) OevDapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\n\n /// @notice Reads the data feed with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithId(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithId(dataFeedId);\n }\n\n /// @notice Reads the data feed with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithDapiNameHash(dapiNameHash);\n }\n\n /// @notice Reads the data feed as the OEV proxy with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithIdAsOevProxy(dataFeedId);\n }\n\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\n }\n\n function dataFeeds(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n\n function oevProxyToIdToDataFeed(\n address proxy,\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _oevProxyToIdToDataFeed[proxy][dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n}\n" + }, + "contracts/api3-server-v1/BeaconUpdatesWithSignedData.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IBeaconUpdatesWithSignedData.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that updates Beacons using signed data\ncontract BeaconUpdatesWithSignedData is\n DataFeedServer,\n IBeaconUpdatesWithSignedData\n{\n using ECDSA for bytes32;\n\n /// @notice Updates a Beacon using data signed by the Airnode\n /// @dev The signed data here is intentionally very general for practical\n /// reasons. It is less demanding on the signer to have data signed once\n /// and use that everywhere.\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param timestamp Signature timestamp\n /// @param data Update data (an `int256` encoded in contract ABI)\n /// @param signature Template ID, timestamp and the update data signed by\n /// the Airnode\n /// @return beaconId Updated Beacon ID\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override returns (bytes32 beaconId) {\n require(\n (\n keccak256(abi.encodePacked(templateId, timestamp, data))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n beaconId = deriveBeaconId(airnode, templateId);\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\n emit UpdatedBeaconWithSignedData(\n beaconId,\n updatedValue,\n uint32(timestamp)\n );\n }\n}\n" + }, + "contracts/api3-server-v1/DapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IDapiServer.sol\";\n\n/// @title Contract that serves dAPIs mapped to Beacons and Beacon sets\n/// @notice Beacons and Beacon sets are addressed by immutable IDs. Although\n/// this is trust-minimized, it requires users to manage the ID of the data\n/// feed they are using. For when the user does not want to do this, dAPIs can\n/// be used as an abstraction layer. By using a dAPI, the user delegates this\n/// responsibility to dAPI management. It is important for dAPI management to\n/// be restricted by consensus rules (by using a multisig or a DAO) and similar\n/// trustless security mechanisms.\ncontract DapiServer is\n AccessControlRegistryAdminnedWithManager,\n DataFeedServer,\n IDapiServer\n{\n /// @notice dAPI name setter role description\n string public constant override DAPI_NAME_SETTER_ROLE_DESCRIPTION =\n \"dAPI name setter\";\n\n /// @notice dAPI name setter role\n bytes32 public immutable override dapiNameSetterRole;\n\n /// @notice dAPI name hash mapped to the data feed ID\n mapping(bytes32 => bytes32) public override dapiNameHashToDataFeedId;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n dapiNameSetterRole = _deriveRole(\n _deriveAdminRole(manager),\n DAPI_NAME_SETTER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Sets the data feed ID the dAPI name points to\n /// @dev While a data feed ID refers to a specific Beacon or Beacon set,\n /// dAPI names provide a more abstract interface for convenience. This\n /// means a dAPI name that was pointing to a Beacon can be pointed to a\n /// Beacon set, then another Beacon set, etc.\n /// @param dapiName Human-readable dAPI name\n /// @param dataFeedId Data feed ID the dAPI name will point to\n function setDapiName(\n bytes32 dapiName,\n bytes32 dataFeedId\n ) external override {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n dapiNameSetterRole,\n msg.sender\n ),\n \"Sender cannot set dAPI name\"\n );\n dapiNameHashToDataFeedId[\n keccak256(abi.encodePacked(dapiName))\n ] = dataFeedId;\n emit SetDapiName(dataFeedId, dapiName, msg.sender);\n }\n\n /// @notice Returns the data feed ID the dAPI name is set to\n /// @param dapiName dAPI name\n /// @return Data feed ID\n function dapiNameToDataFeedId(\n bytes32 dapiName\n ) external view override returns (bytes32) {\n return dapiNameHashToDataFeedId[keccak256(abi.encodePacked(dapiName))];\n }\n\n /// @notice Reads the data feed with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) internal view returns (int224 value, uint32 timestamp) {\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\n require(dataFeedId != bytes32(0), \"dAPI name not set\");\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n require(timestamp > 0, \"Data feed not initialized\");\n }\n}\n" + }, + "contracts/api3-server-v1/DataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../utils/ExtendedSelfMulticall.sol\";\nimport \"./aggregation/Median.sol\";\nimport \"./interfaces/IDataFeedServer.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that serves Beacons and Beacon sets\n/// @notice A Beacon is a live data feed addressed by an ID, which is derived\n/// from an Airnode address and a template ID. This is suitable where the more\n/// recent data point is always more favorable, e.g., in the context of an\n/// asset price data feed. Beacons can also be seen as one-Airnode data feeds\n/// that can be used individually or combined to build Beacon sets.\ncontract DataFeedServer is ExtendedSelfMulticall, Median, IDataFeedServer {\n using ECDSA for bytes32;\n\n // Airnodes serve their fulfillment data along with timestamps. This\n // contract casts the reported data to `int224` and the timestamp to\n // `uint32`, which works until year 2106.\n struct DataFeed {\n int224 value;\n uint32 timestamp;\n }\n\n /// @notice Data feed with ID\n mapping(bytes32 => DataFeed) internal _dataFeeds;\n\n /// @dev Reverts if the timestamp is from more than 1 hour in the future\n modifier onlyValidTimestamp(uint256 timestamp) virtual {\n unchecked {\n require(\n timestamp < block.timestamp + 1 hours,\n \"Timestamp not valid\"\n );\n }\n _;\n }\n\n /// @notice Updates the Beacon set using the current values of its Beacons\n /// @dev As an oddity, this function still works if some of the IDs in\n /// `beaconIds` belong to Beacon sets rather than Beacons. This can be used\n /// to implement hierarchical Beacon sets.\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Beacon set ID\n function updateBeaconSetWithBeacons(\n bytes32[] memory beaconIds\n ) public override returns (bytes32 beaconSetId) {\n (int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(\n beaconIds\n );\n beaconSetId = deriveBeaconSetId(beaconIds);\n DataFeed storage beaconSet = _dataFeeds[beaconSetId];\n if (beaconSet.timestamp == updatedTimestamp) {\n require(\n beaconSet.value != updatedValue,\n \"Does not update Beacon set\"\n );\n }\n _dataFeeds[beaconSetId] = DataFeed({\n value: updatedValue,\n timestamp: updatedTimestamp\n });\n emit UpdatedBeaconSetWithBeacons(\n beaconSetId,\n updatedValue,\n updatedTimestamp\n );\n }\n\n /// @notice Reads the data feed with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithId(\n bytes32 dataFeedId\n ) internal view returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n require(timestamp > 0, \"Data feed not initialized\");\n }\n\n /// @notice Derives the Beacon ID from the Airnode address and template ID\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @return beaconId Beacon ID\n function deriveBeaconId(\n address airnode,\n bytes32 templateId\n ) internal pure returns (bytes32 beaconId) {\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\n }\n\n /// @notice Derives the Beacon set ID from the Beacon IDs\n /// @dev Notice that `abi.encode()` is used over `abi.encodePacked()`\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Beacon set ID\n function deriveBeaconSetId(\n bytes32[] memory beaconIds\n ) internal pure returns (bytes32 beaconSetId) {\n beaconSetId = keccak256(abi.encode(beaconIds));\n }\n\n /// @notice Called privately to process the Beacon update\n /// @param beaconId Beacon ID\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @return updatedBeaconValue Updated Beacon value\n function processBeaconUpdate(\n bytes32 beaconId,\n uint256 timestamp,\n bytes calldata data\n )\n internal\n onlyValidTimestamp(timestamp)\n returns (int224 updatedBeaconValue)\n {\n updatedBeaconValue = decodeFulfillmentData(data);\n require(\n timestamp > _dataFeeds[beaconId].timestamp,\n \"Does not update timestamp\"\n );\n _dataFeeds[beaconId] = DataFeed({\n value: updatedBeaconValue,\n timestamp: uint32(timestamp)\n });\n }\n\n /// @notice Called privately to decode the fulfillment data\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @return decodedData Decoded fulfillment data\n function decodeFulfillmentData(\n bytes memory data\n ) internal pure returns (int224) {\n require(data.length == 32, \"Data length not correct\");\n int256 decodedData = abi.decode(data, (int256));\n require(\n decodedData >= type(int224).min && decodedData <= type(int224).max,\n \"Value typecasting error\"\n );\n return int224(decodedData);\n }\n\n /// @notice Called privately to aggregate the Beacons and return the result\n /// @param beaconIds Beacon IDs\n /// @return value Aggregation value\n /// @return timestamp Aggregation timestamp\n function aggregateBeacons(\n bytes32[] memory beaconIds\n ) internal view returns (int224 value, uint32 timestamp) {\n uint256 beaconCount = beaconIds.length;\n require(beaconCount > 1, \"Specified less than two Beacons\");\n int256[] memory values = new int256[](beaconCount);\n int256[] memory timestamps = new int256[](beaconCount);\n for (uint256 ind = 0; ind < beaconCount; ) {\n DataFeed storage dataFeed = _dataFeeds[beaconIds[ind]];\n values[ind] = dataFeed.value;\n timestamps[ind] = int256(uint256(dataFeed.timestamp));\n unchecked {\n ind++;\n }\n }\n value = int224(median(values));\n timestamp = uint32(uint256(median(timestamps)));\n }\n}\n" + }, + "contracts/api3-server-v1/interfaces/IAirseekerRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access/interfaces/IOwnable.sol\";\nimport \"../../utils/interfaces/IExtendedSelfMulticall.sol\";\n\ninterface IAirseekerRegistry is IOwnable, IExtendedSelfMulticall {\n event ActivatedDataFeedId(bytes32 indexed dataFeedId);\n\n event ActivatedDapiName(bytes32 indexed dapiName);\n\n event DeactivatedDataFeedId(bytes32 indexed dataFeedId);\n\n event DeactivatedDapiName(bytes32 indexed dapiName);\n\n event UpdatedDataFeedIdUpdateParameters(\n bytes32 indexed dataFeedId,\n bytes updateParameters\n );\n\n event UpdatedDapiNameUpdateParameters(\n bytes32 indexed dapiName,\n bytes updateParameters\n );\n\n event UpdatedSignedApiUrl(address indexed airnode, string signedApiUrl);\n\n event RegisteredDataFeed(bytes32 indexed dataFeedId, bytes dataFeedDetails);\n\n function setDataFeedIdToBeActivated(bytes32 dataFeedId) external;\n\n function setDapiNameToBeActivated(bytes32 dapiName) external;\n\n function setDataFeedIdToBeDeactivated(bytes32 dataFeedId) external;\n\n function setDapiNameToBeDeactivated(bytes32 dapiName) external;\n\n function setDataFeedIdUpdateParameters(\n bytes32 dataFeedId,\n bytes calldata updateParameters\n ) external;\n\n function setDapiNameUpdateParameters(\n bytes32 dapiName,\n bytes calldata updateParameters\n ) external;\n\n function setSignedApiUrl(\n address airnode,\n string calldata signedApiUrl\n ) external;\n\n function registerDataFeed(\n bytes calldata dataFeedDetails\n ) external returns (bytes32 dataFeedId);\n\n function activeDataFeed(\n uint256 index\n )\n external\n view\n returns (\n bytes32 dataFeedId,\n bytes32 dapiName,\n bytes memory dataFeedDetails,\n int224 dataFeedValue,\n uint32 dataFeedTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps,\n bytes memory updateParameters,\n string[] memory signedApiUrls\n );\n\n function activeDataFeedCount() external view returns (uint256);\n\n function activeDataFeedIdCount() external view returns (uint256);\n\n function activeDapiNameCount() external view returns (uint256);\n\n function dataFeedIdToUpdateParameters(\n bytes32 dataFeedId\n ) external view returns (bytes memory updateParameters);\n\n function dapiNameToUpdateParameters(\n bytes32 dapiName\n ) external view returns (bytes memory updateParameters);\n\n function dataFeedIsRegistered(\n bytes32 dataFeedId\n ) external view returns (bool);\n\n function MAXIMUM_BEACON_COUNT_IN_SET() external view returns (uint256);\n\n function MAXIMUM_UPDATE_PARAMETERS_LENGTH() external view returns (uint256);\n\n function MAXIMUM_SIGNED_API_URL_LENGTH() external view returns (uint256);\n\n function api3ServerV1() external view returns (address);\n\n function airnodeToSignedApiUrl(\n address airnode\n ) external view returns (string memory signedApiUrl);\n\n function dataFeedIdToDetails(\n bytes32 dataFeedId\n ) external view returns (bytes memory dataFeedDetails);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IApi3Market.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access/interfaces/IHashRegistry.sol\";\nimport \"../../utils/interfaces/IExtendedSelfMulticall.sol\";\n\ninterface IApi3Market is IHashRegistry, IExtendedSelfMulticall {\n event BoughtSubscription(\n bytes32 indexed dapiName,\n bytes32 indexed subscriptionId,\n bytes32 dataFeedId,\n address sponsorWallet,\n bytes updateParameters,\n uint256 duration,\n uint256 price,\n uint256 paymentAmount\n );\n\n event UpdatedCurrentSubscriptionId(\n bytes32 indexed dapiName,\n bytes32 indexed subscriptionId\n );\n\n function buySubscription(\n bytes32 dapiName,\n bytes32 dataFeedId,\n address payable sponsorWallet,\n bytes calldata dapiManagementMerkleData,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price,\n bytes calldata dapiPricingMerkleData\n ) external payable returns (bytes32 subscriptionId);\n\n function updateCurrentSubscriptionId(bytes32 dapiName) external;\n\n function updateDapiName(\n bytes32 dapiName,\n bytes32 dataFeedId,\n address sponsorWallet,\n bytes calldata dapiManagementMerkleData\n ) external;\n\n function updateSignedApiUrl(\n address airnode,\n string calldata signedApiUrl,\n bytes calldata signedApiUrlMerkleData\n ) external;\n\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external returns (bytes32 beaconId);\n\n function updateBeaconSetWithBeacons(\n bytes32[] calldata beaconIds\n ) external returns (bytes32 beaconSetId);\n\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function registerDataFeed(\n bytes calldata dataFeedDetails\n ) external returns (bytes32 dataFeedId);\n\n function computeExpectedSponsorWalletBalance(\n bytes32 dapiName\n ) external view returns (uint256 expectedSponsorWalletBalance);\n\n function computeExpectedSponsorWalletBalanceAfterSubscriptionIsAdded(\n bytes32 dapiName,\n bytes calldata updateParameters,\n uint256 duration,\n uint256 price\n ) external view returns (uint256 expectedSponsorWalletBalance);\n\n function getDapiData(\n bytes32 dapiName\n )\n external\n view\n returns (\n bytes memory dataFeedDetails,\n int224 dapiValue,\n uint32 dapiTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps,\n bytes[] memory updateParameters,\n uint32[] memory endTimestamps,\n uint224[] memory dailyPrices\n );\n\n function getDataFeedData(\n bytes32 dataFeedId\n )\n external\n view\n returns (\n bytes memory dataFeedDetails,\n int224 dataFeedValue,\n uint32 dataFeedTimestamp,\n int224[] memory beaconValues,\n uint32[] memory beaconTimestamps\n );\n\n function subscriptionIdToUpdateParameters(\n bytes32 subscriptionId\n ) external view returns (bytes memory updateParameters);\n\n function MAXIMUM_SUBSCRIPTION_QUEUE_LENGTH()\n external\n view\n returns (uint256);\n\n function DAPI_MANAGEMENT_MERKLE_ROOT_HASH_TYPE()\n external\n view\n returns (bytes32);\n\n function DAPI_PRICING_MERKLE_ROOT_HASH_TYPE()\n external\n view\n returns (bytes32);\n\n function SIGNED_API_URL_MERKLE_ROOT_HASH_TYPE()\n external\n view\n returns (bytes32);\n\n function MAXIMUM_DAPI_UPDATE_AGE() external view returns (uint256);\n\n function api3ServerV1() external view returns (address);\n\n function proxyFactory() external view returns (address);\n\n function airseekerRegistry() external view returns (address);\n\n function subscriptions(\n bytes32 subscriptionId\n )\n external\n view\n returns (\n bytes32 updateParametersHash,\n uint32 endTimestamp,\n uint224 dailyPrice,\n bytes32 nextSubscriptionId\n );\n\n function dapiNameToCurrentSubscriptionId(\n bytes32 dapiName\n ) external view returns (bytes32 currentSubscriptionId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IApi3ServerV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IOevDapiServer.sol\";\nimport \"./IBeaconUpdatesWithSignedData.sol\";\n\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\n function readDataFeedWithId(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) external view returns (int224 value, uint32 timestamp);\n\n function dataFeeds(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function oevProxyToIdToDataFeed(\n address proxy,\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IDataFeedServer.sol\";\n\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external returns (bytes32 beaconId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\nimport \"./IDataFeedServer.sol\";\n\ninterface IDapiServer is\n IAccessControlRegistryAdminnedWithManager,\n IDataFeedServer\n{\n event SetDapiName(\n bytes32 indexed dataFeedId,\n bytes32 indexed dapiName,\n address sender\n );\n\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\n\n function dapiNameToDataFeedId(\n bytes32 dapiName\n ) external view returns (bytes32);\n\n // solhint-disable-next-line func-name-mixedcase\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function dapiNameSetterRole() external view returns (bytes32);\n\n function dapiNameHashToDataFeedId(\n bytes32 dapiNameHash\n ) external view returns (bytes32 dataFeedId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../utils/interfaces/IExtendedSelfMulticall.sol\";\n\ninterface IDataFeedServer is IExtendedSelfMulticall {\n event UpdatedBeaconWithSignedData(\n bytes32 indexed beaconId,\n int224 value,\n uint32 timestamp\n );\n\n event UpdatedBeaconSetWithBeacons(\n bytes32 indexed beaconSetId,\n int224 value,\n uint32 timestamp\n );\n\n function updateBeaconSetWithBeacons(\n bytes32[] memory beaconIds\n ) external returns (bytes32 beaconSetId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IOevAuctionHouse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../../access/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\ninterface IOevAuctionHouse is IAccessControlRegistryAdminnedWithManager {\n enum BidStatus {\n None,\n Placed,\n Awarded,\n FulfillmentReported,\n FulfillmentConfirmed,\n FulfillmentContradicted\n }\n\n event SetCollateralInBasisPoints(uint256 collateralInBasisPoints);\n\n event SetProtocolFeeInBasisPoints(uint256 protocolFeeInBasisPoints);\n\n event SetCollateralRateProxy(address collateralRateProxy);\n\n event SetChainNativeCurrencyRateProxy(\n uint256 indexed chainId,\n address nativeCurrencyRateProxy\n );\n\n event WithdrewAccumulatedSlashedCollateral(\n address recipient,\n uint256 amount\n );\n\n event WithdrewAccumulatedProtocolFees(address recipient, uint256 amount);\n\n event Deposited(\n address indexed bidder,\n uint256 amount,\n uint256 bidderBalance,\n address sender\n );\n\n event InitiatedWithdrawal(\n address indexed bidder,\n uint256 earliestWithdrawalTimestamp\n );\n\n event Withdrew(address indexed bidder, address recipient, uint256 amount);\n\n event CanceledWithdrawal(address indexed bidder);\n\n event PlacedBid(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n uint256 chainId,\n uint256 bidAmount,\n bytes bidDetails,\n uint32 expirationTimestamp,\n uint104 collateralAmount,\n uint104 protocolFeeAmount\n );\n\n event ExpeditedBidExpiration(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n uint32 expirationTimestamp\n );\n\n event AwardedBid(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n bytes awardDetails,\n uint256 bidderBalance\n );\n\n event ReportedFulfillment(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n bytes fulfillmentDetails\n );\n\n event ConfirmedFulfillment(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n uint256 bidderBalance,\n uint256 accumulatedProtocolFees\n );\n\n event ContradictedFulfillment(\n address indexed bidder,\n bytes32 indexed bidTopic,\n bytes32 indexed bidId,\n uint256 bidderBalance,\n uint256 accumulatedSlashedCollateral\n );\n\n error SenderIsNotTheManager();\n\n error SenderIsNotAProxySetterOrTheManager();\n\n error SenderIsNotAWithdrawerOrTheManager();\n\n error SenderIsNotAnAuctioneer();\n\n error ProxyAddressIsZero();\n\n error ChainIdIsZero();\n\n error RecipientAddressIsZero();\n\n error WithdrawalAmountIsZero();\n\n error InsufficientBalance();\n\n error BidderAddressIsZero();\n\n error DepositAmountIsZero();\n\n error BidderHasAlreadyInitiatedWithdrawal();\n\n error SenderHasNotInitiatedWithdrawal();\n\n error BidderCannotWithdrawYet();\n\n error BidAmountIsZero();\n\n error BidDetailsAreEmpty();\n\n error MaximumBidderDataLengthIsExceeded();\n\n error BidLifetimeIsLongerThanMaximum();\n\n error BidLifetimeIsShorterThanMinimum();\n\n error BidIsAlreadyPlaced();\n\n error MaxCollateralAmountIsExceeded();\n\n error MaxProtocolFeeAmountIsExceeded();\n\n error BidIsNotAwaitingAward();\n\n error BidHasExpired();\n\n error TimestampDoesNotExpediteExpiration();\n\n error MaximumAuctioneerDataLengthIsExceeded();\n\n error AwardDetailsAreEmpty();\n\n error AwardHasExpired();\n\n error BidderBalanceIsLowerThanTheLockedAmount();\n\n error FulfillmentDetailsAreEmpty();\n\n error BidIsNotAwaitingFulfillmentReport();\n\n error BidFulfillmentCannotBeConfirmed();\n\n error BidFulfillmentCannotBeContradicted();\n\n error CollateralRateIsNotPositive();\n\n error CollateralRateIsStale();\n\n error NativeCurrencyRateIsNotPositive();\n\n error NativeCurrencyRateIsStale();\n\n function setProtocolFeeInBasisPoints(\n uint256 protocolFeeInBasisPoints_\n ) external;\n\n function setCollateralInBasisPoints(\n uint256 collateralInBasisPoints_\n ) external;\n\n function setCollateralRateProxy(address collateralRateProxy_) external;\n\n function setChainNativeCurrencyRateProxy(\n uint256 chainId,\n address nativeCurrencyRateProxy\n ) external;\n\n function withdrawAccumulatedSlashedCollateral(\n address payable recipient,\n uint256 amount\n ) external;\n\n function withdrawAccumulatedProtocolFees(\n address payable recipient,\n uint256 amount\n ) external;\n\n function depositForBidder(\n address bidder\n ) external payable returns (uint256 bidderBalance);\n\n function deposit() external payable returns (uint256 bidderBalance);\n\n function initiateWithdrawal()\n external\n returns (uint256 earliestWithdrawalTimestamp);\n\n function withdraw(address payable recipient, uint256 amount) external;\n\n function cancelWithdrawal() external;\n\n function placeBidWithExpiration(\n bytes32 bidTopic,\n uint256 chainId,\n uint256 bidAmount,\n bytes calldata bidDetails,\n uint256 maxCollateralAmount,\n uint256 maxProtocolFeeAmount,\n uint32 expirationTimestamp\n ) external returns (uint104 collateralAmount, uint104 protocolFeeAmount);\n\n function placeBid(\n bytes32 bidTopic,\n uint256 chainId,\n uint256 bidAmount,\n bytes calldata bidDetails,\n uint256 maxCollateralAmount,\n uint256 maxProtocolFeeAmount\n )\n external\n returns (\n uint32 expirationTimestamp,\n uint104 collateralAmount,\n uint104 protocolFeeAmount\n );\n\n function expediteBidExpiration(\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n uint32 expirationTimestamp\n ) external;\n\n function expediteBidExpirationMaximally(\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n ) external returns (uint32 expirationTimestamp);\n\n function awardBid(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n bytes calldata awardDetails,\n uint256 awardExpirationTimestamp\n ) external returns (uint256 bidderBalance);\n\n function reportFulfillment(\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n bytes calldata fulfillmentDetails\n ) external;\n\n function confirmFulfillment(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n )\n external\n returns (uint256 bidderBalance, uint256 accumulatedProtocolFees_);\n\n function contradictFulfillment(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n )\n external\n returns (uint256 bidderBalance, uint256 accumulatedSlashedCollateral_);\n\n function getCurrentCollateralAndProtocolFeeAmounts(\n uint256 chainId,\n uint256 bidAmount\n )\n external\n view\n returns (uint104 collateralAmount, uint104 protocolFeeAmount);\n\n function PROXY_SETTER_ROLE_DESCRIPTION() external returns (string memory);\n\n function WITHDRAWER_ROLE_DESCRIPTION() external returns (string memory);\n\n function AUCTIONEER_ROLE_DESCRIPTION() external returns (string memory);\n\n function WITHDRAWAL_WAITING_PERIOD() external returns (uint256);\n\n function MAXIMUM_BID_LIFETIME() external returns (uint256);\n\n function MINIMUM_BID_LIFETIME() external returns (uint256);\n\n function FULFILLMENT_REPORTING_PERIOD() external returns (uint256);\n\n function MAXIMUM_BIDDER_DATA_LENGTH() external returns (uint256);\n\n function MAXIMUM_AUCTIONEER_DATA_LENGTH() external returns (uint256);\n\n function proxySetterRole() external returns (bytes32);\n\n function withdrawerRole() external returns (bytes32);\n\n function auctioneerRole() external returns (bytes32);\n\n function protocolFeeInBasisPoints() external returns (uint256);\n\n function collateralInBasisPoints() external returns (uint256);\n\n function collateralRateProxy() external returns (address);\n\n function chainIdToNativeCurrencyRateProxy(\n uint256 chainId\n ) external returns (address nativeCurrencyRateProxy);\n\n function accumulatedSlashedCollateral() external returns (uint256);\n\n function accumulatedProtocolFees() external returns (uint256);\n\n function bidderToBalance(address bidder) external returns (uint256 balance);\n\n function bidderToEarliestWithdrawalTimestamp(\n address bidder\n ) external returns (uint256 earliestWithdrawalTimestamp);\n\n function bids(\n bytes32 bidId\n )\n external\n returns (\n BidStatus status,\n uint32 expirationTimestamp,\n uint104 collateralAmount,\n uint104 protocolFeeAmount\n );\n}\n" + }, + "contracts/api3-server-v1/interfaces/IOevDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IOevDataFeedServer.sol\";\nimport \"./IDapiServer.sol\";\n\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\n" + }, + "contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IDataFeedServer.sol\";\n\ninterface IOevDataFeedServer is IDataFeedServer {\n event UpdatedOevProxyBeaconWithSignedData(\n bytes32 indexed beaconId,\n address indexed proxy,\n bytes32 indexed updateId,\n int224 value,\n uint32 timestamp\n );\n\n event UpdatedOevProxyBeaconSetWithSignedData(\n bytes32 indexed beaconSetId,\n address indexed proxy,\n bytes32 indexed updateId,\n int224 value,\n uint32 timestamp\n );\n\n event Withdrew(\n address indexed oevProxy,\n address oevBeneficiary,\n uint256 amount\n );\n\n function updateOevProxyDataFeedWithSignedData(\n address oevProxy,\n bytes32 dataFeedId,\n bytes32 updateId,\n uint256 timestamp,\n bytes calldata data,\n bytes[] calldata packedOevUpdateSignatures\n ) external payable;\n\n function withdraw(address oevProxy) external;\n\n function oevProxyToBalance(\n address oevProxy\n ) external view returns (uint256 balance);\n}\n" + }, + "contracts/api3-server-v1/OevAuctionHouse.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IOevAuctionHouse.sol\";\nimport \"./proxies/interfaces/IProxy.sol\";\n\n/// @title OEV Auction House contract\n/// @notice OEV is a subset of MEV that oracles have exclusive priority of\n/// extraction. API3 holds OEV auctions for its data feed services and forwards\n/// the proceeds to the respective user dApps. OevAuctionHouse is the platform\n/// that OEV searchers can bid on data feed updates that satisfy specific\n/// conditions, and report that they have fulfilled the updates that they are\n/// awarded. Refer to Api3ServerV1.sol for how the awarded updates are to be\n/// fulfilled and how the beneficiaries can withdraw the auction proceeds.\n/// @dev OevAuctionHouse is intended to be deployed on a single chain, while\n/// Api3ServerV1 (the API3 data feed contract) is deployed on the chains that\n/// the respective user dApps are deployed on. An OEV searcher bids on an\n/// update at OevAuctionHouse, gets the larger of the collateral and protocol\n/// fee locked up at OevAuctionHouse when they are awarded the update, fulfill\n/// the update and pay their bid amount at Api3ServerV1, and report back to\n/// OevAuctionHouse to have their locked funds released and the protocol fee\n/// charged. This flow implies the need for a certain kind of a cross-chain\n/// oracle functionality (to check if the awarded update is fulfilled), which\n/// is provided by the auctioneer role in this contract. The same auctioneer\n/// role is also assigned to award the individual updates to the winning bids.\n/// This means that the trustlessness of the auctions is limited by the\n/// trustlessness of the auctioneer implementation. Although trustlessness of\n/// OEV auctions is ideal, the primary goal of OevAuctionHouse is to facilitate\n/// auctions in a transparent and accountable manner.\ncontract OevAuctionHouse is\n AccessControlRegistryAdminnedWithManager,\n IOevAuctionHouse\n{\n // The collateral and protocol fee amounts are denominated in the native\n // currency of the chain that OevAuctionHouse is deployed on. In the case\n // that this currency is ETH, the variable sizes below for collateral and\n // protocol fee are expected to be sufficient.\n struct Bid {\n BidStatus status;\n uint32 expirationTimestamp;\n uint104 collateralAmount;\n uint104 protocolFeeAmount;\n }\n\n /// @notice Proxy setter role description\n string public constant override PROXY_SETTER_ROLE_DESCRIPTION =\n \"Proxy setter\";\n\n /// @notice Withdrawer role description\n string public constant override WITHDRAWER_ROLE_DESCRIPTION = \"Withdrawer\";\n\n /// @notice Auctioneer role description\n string public constant override AUCTIONEER_ROLE_DESCRIPTION = \"Auctioneer\";\n\n /// @notice Amount of time that the bidders are required to wait after\n /// initiating a withdrawal to execute it\n /// @dev This is enforced to prevent the bidders from frontrunning bid\n /// awarding transactions with withdrawals to deny service\n uint256 public constant override WITHDRAWAL_WAITING_PERIOD = 15 seconds;\n\n /// @notice Longest period during which a bid can be awarded after it has\n /// been placed\n /// @dev Considering each bid for each auction incurs a (computational,\n /// network, etc.) cost to the auctioneer, the bids need to automatically\n /// fall out of scope over time or they will eventually accumulate to an\n /// unmanageable amount\n uint256 public constant override MAXIMUM_BID_LIFETIME = 1 days;\n\n /// @notice Minimum lifetime that a bid can be specified to have\n /// @dev This is enforced to prevent bidders from frontrunning bid awarding\n /// transactions with bid expiration expedition transactions to deny\n /// service\n uint256 public constant override MINIMUM_BID_LIFETIME = 15 seconds;\n\n /// @notice Period during which a bidder is allowed to report the\n /// fulfillment after the bid award\n /// @dev The bidder should execute the won update in a matter of seconds,\n /// and the fulfillment report can follow right after. However, the\n /// fulfillment reporting period is kept long enough to accomodate for a\n /// more relaxed workflow, e.g., the bidder multi-calls their fulfillment\n /// reports every hour.\n uint256 public constant override FULFILLMENT_REPORTING_PERIOD = 1 days;\n\n /// @notice Maximum data length that a bidder can submit while placing a\n /// bid or reporting a fulfillment\n uint256 public constant override MAXIMUM_BIDDER_DATA_LENGTH = 1024;\n\n /// @notice Maximum data length that an auctioneer can submit while\n /// awarding a bid\n uint256 public constant override MAXIMUM_AUCTIONEER_DATA_LENGTH = 8192;\n\n /// @notice Proxy setter role\n bytes32 public immutable override proxySetterRole;\n\n /// @notice Withdrawer role\n bytes32 public immutable override withdrawerRole;\n\n /// @notice Auctioneer role\n bytes32 public immutable override auctioneerRole;\n\n /// @notice Collateral requirement in relation to the bid amount in basis\n /// points\n /// @dev The collateral requirement can range from 0% to values larger than\n /// 100%. This is because one can hypothesize cases where denying service\n /// by being slashed by the full bid amount is still profitable, in which\n /// case a collateral requirement that is larger than 100% would be\n /// justifiable.\n uint256 public override collateralInBasisPoints;\n\n /// @notice Protocol fee in relation to the bid amount in basis points\n /// @dev The protocol fee is not necessarily bounded by the bid amount,\n /// which means that this value is not necessarily bounded by 100%\n uint256 public override protocolFeeInBasisPoints;\n\n /// @notice Data feed proxy address for the collateral rate\n /// @dev The collateral is denominated in the native currency of the chain\n /// that OevAuctionHouse is deployed on. Bid amounts are specified and paid\n /// in the native currency of the chain that the dApp (from which OEV is\n /// being extracted from) is deployed on. This means that a common base is\n /// needed for the collateral rate and the native currency rates. For\n /// example, if the collateral rate proxy provides the ETH/USD rate, the\n /// native currency rate proxies should provide */USD rates.\n address public override collateralRateProxy;\n\n /// @notice Data feed proxy address for the native currency of the chain\n /// with the ID\n mapping(uint256 => address)\n public\n override chainIdToNativeCurrencyRateProxy;\n\n /// @notice Accumulated collateral funds slashed by auctioneers by\n /// contradicting fulfillments\n uint256 public override accumulatedSlashedCollateral;\n\n /// @notice Accumulated protocol fees charged by auctioneers by confirming\n /// fulfillments\n uint256 public override accumulatedProtocolFees;\n\n /// @notice Deposited funds of the bidder, excluding the amount that is\n /// currently locked up for awarded bids awaiting fulfillment confirmation\n mapping(address => uint256) public override bidderToBalance;\n\n /// @notice Earliest time that the bidder can execute the initiated\n /// withdrawal. A timestamp of zero means that there is no ongoing\n /// withdrawal.\n mapping(address => uint256)\n public\n override bidderToEarliestWithdrawalTimestamp;\n\n /// @notice Status, expiration timestamp, collateral amount and protocol\n /// fee amount of the bid with ID\n mapping(bytes32 => Bid) public override bids;\n\n uint256 private constant HUNDRED_PERCENT_IN_BASIS_POINTS = 100 * 100;\n\n uint256 private constant MAXIMUM_RATE_AGE = 1 days;\n\n /// @dev Reverts if the sender is not the contract manager\n modifier onlyManager() {\n if (msg.sender != manager) revert SenderIsNotTheManager();\n _;\n }\n\n /// @dev Reverts if the sender is not a proxy setter or the contract\n /// manager\n modifier onlyProxySetterOrManager() {\n if (\n !IAccessControlRegistry(accessControlRegistry).hasRole(\n proxySetterRole,\n msg.sender\n ) && msg.sender != manager\n ) revert SenderIsNotAProxySetterOrTheManager();\n _;\n }\n\n /// @dev Reverts if the sender is not a withdrawer or the contract manager\n modifier onlyWithdrawerOrManager() {\n if (\n !IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawerRole,\n msg.sender\n ) && msg.sender != manager\n ) revert SenderIsNotAWithdrawerOrTheManager();\n _;\n }\n\n /// @dev Reverts if the sender is not an auctioneer\n modifier onlyAuctioneer() {\n if (\n !IAccessControlRegistry(accessControlRegistry).hasRole(\n auctioneerRole,\n msg.sender\n )\n ) revert SenderIsNotAnAuctioneer();\n _;\n }\n\n /// @dev Reverts if the withdrawal parameters are not valid\n /// @param recipient Recipient address\n /// @param amount Amount\n modifier onlyValidWithdrawalParameters(\n address payable recipient,\n uint256 amount\n ) {\n if (recipient == address(0)) revert RecipientAddressIsZero();\n if (amount == 0) revert WithdrawalAmountIsZero();\n _;\n }\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n proxySetterRole = _deriveRole(\n _deriveAdminRole(manager),\n PROXY_SETTER_ROLE_DESCRIPTION\n );\n withdrawerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWER_ROLE_DESCRIPTION\n );\n auctioneerRole = _deriveRole(\n _deriveAdminRole(manager),\n AUCTIONEER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called by the manager to set the collateral requirement in\n /// basis points\n /// @dev The collateral requirement can range from 0% (0 in basis points)\n /// to values larger than 100% (10000 in basis points).\n /// The contract manager is recommended to tune this parameter to maximize\n /// the extracted OEV. The optimal value will be defined by bidder behavior\n /// and may change over time.\n /// In the absence of additional incentives (e.g., a reputation system that\n /// refers to confirmed fulfillments), a collateral requirement that is not\n /// larger than the protocol fee may result in fulfillments going\n /// unreported (as being slashed would not be more punitive than being\n /// charged the protocol fee).\n /// @param collateralInBasisPoints_ Collateral requirement in basis points\n function setCollateralInBasisPoints(\n uint256 collateralInBasisPoints_\n ) external override onlyManager {\n collateralInBasisPoints = collateralInBasisPoints_;\n emit SetCollateralInBasisPoints(collateralInBasisPoints_);\n }\n\n /// @notice Called by the manager to set the protocol fee in basis points\n /// @dev The protocol fee can range from 0% (0 in basis points) to values\n /// larger than 100% (10000 in basis points)\n /// @param protocolFeeInBasisPoints_ Protocol fee in basis points\n function setProtocolFeeInBasisPoints(\n uint256 protocolFeeInBasisPoints_\n ) external override onlyManager {\n protocolFeeInBasisPoints = protocolFeeInBasisPoints_;\n emit SetProtocolFeeInBasisPoints(protocolFeeInBasisPoints_);\n }\n\n /// @notice Sets collateral rate proxy\n /// @dev The data feed proxy contract is expected to implement the IProxy\n /// interface and the respective data feed to be active with at most a\n /// 1-day heartbeat interval. Only use trusted contracts (e.g., contracts\n /// deployed by API3's ProxyFactory) to avoid reentrancy risks.\n /// The collateral rate denomination must match the native curreny rate\n /// denomination, e.g., if the collateral rate is in the form of ETH/USD,\n /// the native currency rates should be in the form of */USD.\n /// @param collateralRateProxy_ Collateral rate proxy address\n function setCollateralRateProxy(\n address collateralRateProxy_\n ) external override onlyProxySetterOrManager {\n if (collateralRateProxy_ == address(0)) revert ProxyAddressIsZero();\n collateralRateProxy = collateralRateProxy_;\n emit SetCollateralRateProxy(collateralRateProxy_);\n }\n\n /// @notice Sets native currency rate proxy for the chain with ID\n /// @dev The data feed proxy contract is expected to implement the IProxy\n /// interface and the respective data feed to be active with at most a\n /// 1-day heartbeat interval. Only use trusted contracts (e.g., contracts\n /// deployed by API3's ProxyFactory) to avoid reentrancy risks.\n /// The collateral rate denomination must match the native curreny rate\n /// denomination, e.g., if the collateral rate is in the form of ETH/USD,\n /// the native currency rates should be in the form of */USD.\n /// @param chainId Chain ID\n /// @param nativeCurrencyRateProxy Native currency rate proxy address\n function setChainNativeCurrencyRateProxy(\n uint256 chainId,\n address nativeCurrencyRateProxy\n ) external override onlyProxySetterOrManager {\n if (chainId == 0) revert ChainIdIsZero();\n if (nativeCurrencyRateProxy == address(0)) revert ProxyAddressIsZero();\n chainIdToNativeCurrencyRateProxy[chainId] = nativeCurrencyRateProxy;\n emit SetChainNativeCurrencyRateProxy(chainId, nativeCurrencyRateProxy);\n }\n\n /// @notice Called by the contract manager to withdraw the accumulated\n /// collateral slashed by auctioneers by contradicting fulfillments\n /// @param recipient Recipient address\n /// @param amount Amount\n function withdrawAccumulatedSlashedCollateral(\n address payable recipient,\n uint256 amount\n )\n external\n override\n onlyWithdrawerOrManager\n onlyValidWithdrawalParameters(recipient, amount)\n {\n if (amount > accumulatedSlashedCollateral) revert InsufficientBalance();\n accumulatedSlashedCollateral -= amount;\n emit WithdrewAccumulatedSlashedCollateral(recipient, amount);\n sendValue(recipient, amount);\n }\n\n /// @notice Called by the contract manager to withdraw the accumulated\n /// protocol fees charged by auctioneers by confirming fulfillments\n /// @param recipient Recipient address\n /// @param amount Amount\n function withdrawAccumulatedProtocolFees(\n address payable recipient,\n uint256 amount\n )\n external\n override\n onlyWithdrawerOrManager\n onlyValidWithdrawalParameters(recipient, amount)\n {\n if (amount > accumulatedProtocolFees) revert InsufficientBalance();\n accumulatedProtocolFees -= amount;\n emit WithdrewAccumulatedProtocolFees(recipient, amount);\n sendValue(recipient, amount);\n }\n\n /// @notice Called to deposit funds for a bidder\n /// @param bidder Bidder address\n /// @return bidderBalance Bidder balance after the deposit\n function depositForBidder(\n address bidder\n ) public payable override returns (uint256 bidderBalance) {\n if (bidder == address(0)) revert BidderAddressIsZero();\n if (msg.value == 0) revert DepositAmountIsZero();\n bidderBalance = bidderToBalance[bidder] + msg.value;\n bidderToBalance[bidder] = bidderBalance;\n emit Deposited(bidder, msg.value, bidderBalance, msg.sender);\n }\n\n /// @notice Called by the bidder to deposit funds\n /// @return bidderBalance Bidder balance after the deposit\n function deposit()\n external\n payable\n override\n returns (uint256 bidderBalance)\n {\n bidderBalance = depositForBidder(msg.sender);\n }\n\n /// @notice Called by the bidder to initiate a withdrawal of their funds\n /// @dev A two-step withdrawal process is implemented to prevent the\n /// bidders from frontrunning bid awarding transactions with withdrawals to\n /// deny service\n /// @return earliestWithdrawalTimestamp Earliest time that the bidder can\n /// execute the initiated withdrawal\n function initiateWithdrawal()\n external\n override\n returns (uint256 earliestWithdrawalTimestamp)\n {\n if (bidderToEarliestWithdrawalTimestamp[msg.sender] != 0)\n revert BidderHasAlreadyInitiatedWithdrawal();\n earliestWithdrawalTimestamp =\n block.timestamp +\n WITHDRAWAL_WAITING_PERIOD;\n bidderToEarliestWithdrawalTimestamp[\n msg.sender\n ] = earliestWithdrawalTimestamp;\n emit InitiatedWithdrawal(msg.sender, earliestWithdrawalTimestamp);\n }\n\n /// @notice Called by the bidder to execute a withdrawal that they have\n /// initiated\n /// @param recipient Recipient address\n /// @param amount Amount\n function withdraw(\n address payable recipient,\n uint256 amount\n ) external override onlyValidWithdrawalParameters(recipient, amount) {\n uint256 balance = bidderToBalance[msg.sender];\n if (amount > balance) revert InsufficientBalance();\n uint256 earliestWithdrawalTimestamp = bidderToEarliestWithdrawalTimestamp[\n msg.sender\n ];\n if (earliestWithdrawalTimestamp == 0)\n revert SenderHasNotInitiatedWithdrawal();\n if (block.timestamp < earliestWithdrawalTimestamp)\n revert BidderCannotWithdrawYet();\n bidderToBalance[msg.sender] = balance - amount;\n bidderToEarliestWithdrawalTimestamp[msg.sender] = 0;\n emit Withdrew(msg.sender, recipient, amount);\n sendValue(recipient, amount);\n }\n\n /// @notice Called by the bidder to cancel a withdrawal that they have\n /// initiated\n function cancelWithdrawal() external override {\n if (bidderToEarliestWithdrawalTimestamp[msg.sender] == 0)\n revert SenderHasNotInitiatedWithdrawal();\n bidderToEarliestWithdrawalTimestamp[msg.sender] = 0;\n emit CanceledWithdrawal(msg.sender);\n }\n\n /// @notice Called to place a bid with an expiration timestamp. Searchers\n /// should use this over `placeBid()` if they expect the OEV opportunity to\n /// disappear at a specific time before the maximum bid lifetime.\n /// The searcher should determine maximum collateral and protocol fees that\n /// they will tolerate, and specify them in the arguments.\n /// Upon the awarding of the bid, the larger of the collateral amount and\n /// protocol fee amount will be locked. Upon confirmation or contradiction\n /// of the respective fulfillment, the locked amount will be released, and\n /// the protocol fee will be charged or the collateral amount will be\n /// slashed, respectively.\n /// @dev `bidTopic` is an arbitrary identifier of the bid type.\n /// `bidDetails` is an arbitrary description of the bid details. Refer to\n /// the documentation that the auctioneer provides for the bidders for how\n /// these parameters should be set.\n /// @param bidTopic Bid topic\n /// @param chainId Chain ID\n /// @param bidAmount Bid amount in the native currency of the chain with ID\n /// @param bidDetails Bid details\n /// @param maxCollateralAmount Maximum collateral amount in the currency of\n /// the chain that OevAuctionHouse is deployed on\n /// @param maxProtocolFeeAmount Maximum protocol fee amount in the currency\n /// of the chain that OevAuctionHouse is deployed on\n /// @param expirationTimestamp Expiration timestamp after which the bid\n /// cannot be awarded\n /// @return collateralAmount Collateral amount in the currency of the chain\n /// that OevAuctionHouse is deployed on\n /// @return protocolFeeAmount Protocol fee amount in the currency of the\n /// chain that OevAuctionHouse is deployed on\n function placeBidWithExpiration(\n bytes32 bidTopic,\n uint256 chainId,\n uint256 bidAmount,\n bytes calldata bidDetails,\n uint256 maxCollateralAmount,\n uint256 maxProtocolFeeAmount,\n uint32 expirationTimestamp\n )\n public\n override\n returns (uint104 collateralAmount, uint104 protocolFeeAmount)\n {\n if (chainId == 0) revert ChainIdIsZero();\n if (bidAmount == 0) revert BidAmountIsZero();\n uint256 bidDetailsLength = bidDetails.length;\n if (bidDetailsLength > MAXIMUM_BIDDER_DATA_LENGTH)\n revert MaximumBidderDataLengthIsExceeded();\n if (bidDetailsLength == 0) revert BidDetailsAreEmpty();\n if (block.timestamp + MAXIMUM_BID_LIFETIME < expirationTimestamp)\n revert BidLifetimeIsLongerThanMaximum();\n if (block.timestamp + MINIMUM_BID_LIFETIME > expirationTimestamp)\n revert BidLifetimeIsShorterThanMinimum();\n // The bid details should be specified to include a salt field to allow\n // bids that otherwise would have identical IDs\n bytes32 bidId = keccak256(\n abi.encodePacked(msg.sender, bidTopic, keccak256(bidDetails))\n );\n if (bids[bidId].status != BidStatus.None) revert BidIsAlreadyPlaced();\n (\n collateralAmount,\n protocolFeeAmount\n ) = getCurrentCollateralAndProtocolFeeAmounts(chainId, bidAmount);\n if (collateralAmount > maxCollateralAmount)\n revert MaxCollateralAmountIsExceeded();\n if (protocolFeeAmount > maxProtocolFeeAmount)\n revert MaxProtocolFeeAmountIsExceeded();\n bids[bidId] = Bid({\n status: BidStatus.Placed,\n expirationTimestamp: expirationTimestamp,\n collateralAmount: collateralAmount,\n protocolFeeAmount: protocolFeeAmount\n });\n emit PlacedBid(\n msg.sender,\n bidTopic,\n bidId,\n chainId,\n bidAmount,\n bidDetails,\n expirationTimestamp,\n collateralAmount,\n protocolFeeAmount\n );\n }\n\n /// @notice Called to place a bid with the longest possible lifetime.\n /// The searcher should determine maximum collateral and protocol fees that\n /// they will tolerate, and specify them in the arguments.\n /// Upon the awarding of the bid, the larger of the collateral amount and\n /// protocol fee amount will be locked. Upon confirmation or contradiction\n /// of the respective fulfillment, the locked amount will be released, and\n /// the protocol fee will be charged or the collateral amount will be\n /// slashed, respectively.\n /// @param bidTopic Bid topic\n /// @param chainId Chain ID\n /// @param bidAmount Bid amount in the native currency of the chain with ID\n /// @param bidDetails Bid details\n /// @param maxCollateralAmount Maximum collateral amount in the currency of\n /// the chain that OevAuctionHouse is deployed on\n /// @param maxProtocolFeeAmount Maximum protocol fee amount in the currency\n /// of the chain that OevAuctionHouse is deployed on\n /// @return expirationTimestamp Expiration timestamp after which the bid\n /// cannot be awarded\n /// @return collateralAmount Collateral amount in the currency of the chain\n /// that OevAuctionHouse is deployed on\n /// @return protocolFeeAmount Protocol fee amount in the currency of the\n /// chain that OevAuctionHouse is deployed on\n function placeBid(\n bytes32 bidTopic,\n uint256 chainId,\n uint256 bidAmount,\n bytes calldata bidDetails,\n uint256 maxCollateralAmount,\n uint256 maxProtocolFeeAmount\n )\n external\n override\n returns (\n uint32 expirationTimestamp,\n uint104 collateralAmount,\n uint104 protocolFeeAmount\n )\n {\n expirationTimestamp = uint32(block.timestamp + MAXIMUM_BID_LIFETIME);\n (collateralAmount, protocolFeeAmount) = placeBidWithExpiration(\n bidTopic,\n chainId,\n bidAmount,\n bidDetails,\n maxCollateralAmount,\n maxProtocolFeeAmount,\n expirationTimestamp\n );\n }\n\n /// @notice Called to update the bid expiration timestamp to a specific\n /// value to expedite its expiration\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @param expirationTimestamp Expiration timestamp after which the bid\n /// cannot be awarded\n function expediteBidExpiration(\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n uint32 expirationTimestamp\n ) public override {\n bytes32 bidId = keccak256(\n abi.encodePacked(msg.sender, bidTopic, bidDetailsHash)\n );\n Bid storage bid = bids[bidId];\n if (bid.status != BidStatus.Placed) revert BidIsNotAwaitingAward();\n uint32 bidExpirationTimestamp = bid.expirationTimestamp;\n if (block.timestamp >= bidExpirationTimestamp) revert BidHasExpired();\n if (expirationTimestamp >= bidExpirationTimestamp)\n revert TimestampDoesNotExpediteExpiration();\n if (block.timestamp + MINIMUM_BID_LIFETIME > expirationTimestamp)\n revert BidLifetimeIsShorterThanMinimum();\n bid.expirationTimestamp = expirationTimestamp;\n emit ExpeditedBidExpiration(\n msg.sender,\n bidTopic,\n bidId,\n expirationTimestamp\n );\n }\n\n /// @notice Called to decrease the bid expiration timestamp as much as\n /// possible to maximally expedite its expiration\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @return expirationTimestamp Expiration timestamp after which the bid\n /// cannot be awarded\n function expediteBidExpirationMaximally(\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n ) external override returns (uint32 expirationTimestamp) {\n expirationTimestamp = uint32(block.timestamp + MINIMUM_BID_LIFETIME);\n expediteBidExpiration(bidTopic, bidDetailsHash, expirationTimestamp);\n }\n\n /// @notice Called by an auctioneer to award the bid\n /// @dev `awardDetails` is an arbitrary description of how to claim the\n /// award. Refer to the documentation that the auctioneer provides for the\n /// bidders for how to use it.\n /// The bidder receiving `awardDetails` is typically time-critical.\n /// However, the bid awarding transaction may not always be confirmed\n /// immediately. To avoid unjust collateral lockups or slashings,\n /// auctioneers should use an appropriate `awardExpirationTimestamp` that\n /// will cause such transactions to revert.\n /// @param bidder Bidder address\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @param awardDetails Award details\n /// @param awardExpirationTimestamp Award expiration timestamp\n /// @return bidderBalance Bidder balance after the lockup\n function awardBid(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n bytes calldata awardDetails,\n uint256 awardExpirationTimestamp\n ) external override onlyAuctioneer returns (uint256 bidderBalance) {\n uint256 awardDetailsLength = awardDetails.length;\n if (awardDetailsLength > MAXIMUM_AUCTIONEER_DATA_LENGTH)\n revert MaximumAuctioneerDataLengthIsExceeded();\n if (awardDetailsLength == 0) revert AwardDetailsAreEmpty();\n if (block.timestamp >= awardExpirationTimestamp)\n revert AwardHasExpired();\n bytes32 bidId = keccak256(\n abi.encodePacked(bidder, bidTopic, bidDetailsHash)\n );\n Bid storage bid = bids[bidId];\n if (bid.status != BidStatus.Placed) revert BidIsNotAwaitingAward();\n if (block.timestamp >= bid.expirationTimestamp) revert BidHasExpired();\n bid.status = BidStatus.Awarded;\n // Refresh the expiration timestamp for the fulfillment report\n bid.expirationTimestamp = uint32(\n block.timestamp + FULFILLMENT_REPORTING_PERIOD\n );\n bidderBalance = bidderToBalance[bidder];\n uint256 lockedAmount = bid.collateralAmount > bid.protocolFeeAmount\n ? bid.collateralAmount\n : bid.protocolFeeAmount;\n if (bidderBalance < lockedAmount)\n revert BidderBalanceIsLowerThanTheLockedAmount();\n bidderBalance -= lockedAmount;\n bidderToBalance[bidder] = bidderBalance;\n emit AwardedBid(bidder, bidTopic, bidId, awardDetails, bidderBalance);\n }\n\n /// @notice Called by the owner of the awarded bid to report its\n /// fulfillment\n /// @dev `fulfillmentDetails` is an arbitrary description of how the\n /// fulfillment is to be verified. Refer to the documentation that the\n /// auctioneer provides for the bidders for how this parameter should be\n /// set.\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @param fulfillmentDetails Fulfillment details\n function reportFulfillment(\n bytes32 bidTopic,\n bytes32 bidDetailsHash,\n bytes calldata fulfillmentDetails\n ) external override {\n uint256 fulfillmentDetailsLength = fulfillmentDetails.length;\n if (fulfillmentDetailsLength > MAXIMUM_BIDDER_DATA_LENGTH)\n revert MaximumBidderDataLengthIsExceeded();\n if (fulfillmentDetailsLength == 0) revert FulfillmentDetailsAreEmpty();\n bytes32 bidId = keccak256(\n abi.encodePacked(msg.sender, bidTopic, bidDetailsHash)\n );\n Bid storage bid = bids[bidId];\n if (bid.status != BidStatus.Awarded)\n revert BidIsNotAwaitingFulfillmentReport();\n if (block.timestamp >= bid.expirationTimestamp) revert BidHasExpired();\n bid.status = BidStatus.FulfillmentReported;\n emit ReportedFulfillment(\n msg.sender,\n bidTopic,\n bidId,\n fulfillmentDetails\n );\n }\n\n /// @notice Called by an auctioneer to confirm a fulfillment, and release\n /// the collateral and charge the protocol fee\n /// @dev A fulfillment does not have to be reported to be confirmed. A bid\n /// can be confirmed to be fulfilled even after it has expired.\n /// @param bidder Bidder address\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @return bidderBalance Bidder balance after the collateral release\n /// @return accumulatedProtocolFees_ Accumulated protocol fees\n function confirmFulfillment(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n )\n external\n override\n onlyAuctioneer\n returns (uint256 bidderBalance, uint256 accumulatedProtocolFees_)\n {\n bytes32 bidId = keccak256(\n abi.encodePacked(bidder, bidTopic, bidDetailsHash)\n );\n Bid storage bid = bids[bidId];\n if (\n bid.status != BidStatus.FulfillmentReported &&\n bid.status != BidStatus.Awarded\n ) revert BidFulfillmentCannotBeConfirmed();\n bid.status = BidStatus.FulfillmentConfirmed;\n bidderBalance =\n bidderToBalance[bidder] +\n (\n bid.collateralAmount > bid.protocolFeeAmount\n ? bid.collateralAmount\n : bid.protocolFeeAmount\n ) -\n bid.protocolFeeAmount;\n bidderToBalance[bidder] = bidderBalance;\n accumulatedProtocolFees_ =\n accumulatedProtocolFees +\n bid.protocolFeeAmount;\n accumulatedProtocolFees = accumulatedProtocolFees_;\n emit ConfirmedFulfillment(\n bidder,\n bidTopic,\n bidId,\n bidderBalance,\n accumulatedProtocolFees_\n );\n }\n\n /// @notice Called by an auctioneer to contradict a fulfillment, and slash\n /// the collateral and release the protocol fee\n /// @dev Fulfillments that have not been reported can only be contradicted\n /// after the reporting period is over\n /// @param bidder Bidder address\n /// @param bidTopic Bid topic\n /// @param bidDetailsHash Bid details hash\n /// @return bidderBalance Bidder balance after the protocol fee release\n /// @return accumulatedSlashedCollateral_ Accumulated slashed collateral\n function contradictFulfillment(\n address bidder,\n bytes32 bidTopic,\n bytes32 bidDetailsHash\n )\n external\n override\n onlyAuctioneer\n returns (uint256 bidderBalance, uint256 accumulatedSlashedCollateral_)\n {\n bytes32 bidId = keccak256(\n abi.encodePacked(bidder, bidTopic, bidDetailsHash)\n );\n Bid storage bid = bids[bidId];\n BidStatus bidStatus = bid.status;\n if (\n bidStatus != BidStatus.FulfillmentReported &&\n !(bidStatus == BidStatus.Awarded &&\n block.timestamp >= bid.expirationTimestamp)\n ) revert BidFulfillmentCannotBeContradicted();\n bid.status = BidStatus.FulfillmentContradicted;\n bidderBalance =\n bidderToBalance[bidder] +\n (\n bid.collateralAmount > bid.protocolFeeAmount\n ? bid.collateralAmount\n : bid.protocolFeeAmount\n ) -\n bid.collateralAmount;\n bidderToBalance[bidder] = bidderBalance;\n accumulatedSlashedCollateral_ =\n accumulatedSlashedCollateral +\n bid.collateralAmount;\n accumulatedSlashedCollateral = accumulatedSlashedCollateral_;\n emit ContradictedFulfillment(\n bidder,\n bidTopic,\n bidId,\n bidderBalance,\n accumulatedSlashedCollateral_\n );\n }\n\n /// @notice Gets the collateral amount and the protocol fee amount for a\n /// bid with the chain ID and amount parameters based on the current rates,\n /// collateral requirement and protocol fee\n /// @param chainId Chain ID\n /// @param bidAmount Bid amount in the native currency of the chain with ID\n /// @return collateralAmount Collateral amount in the currency of the chain\n /// that OevAuctionHouse is deployed on\n /// @return protocolFeeAmount Protocol fee amount in the currency of the\n /// chain that OevAuctionHouse is deployed on\n function getCurrentCollateralAndProtocolFeeAmounts(\n uint256 chainId,\n uint256 bidAmount\n )\n public\n view\n override\n returns (uint104 collateralAmount, uint104 protocolFeeAmount)\n {\n (int224 collateralRateValue, uint32 collateralRateTimestamp) = IProxy(\n collateralRateProxy\n ).read();\n if (collateralRateValue <= 0) revert CollateralRateIsNotPositive();\n if (block.timestamp >= collateralRateTimestamp + MAXIMUM_RATE_AGE)\n revert CollateralRateIsStale();\n (\n int224 nativeCurrencyRateValue,\n uint32 nativeCurrencyRateTimestamp\n ) = IProxy(chainIdToNativeCurrencyRateProxy[chainId]).read();\n if (nativeCurrencyRateValue <= 0)\n revert NativeCurrencyRateIsNotPositive();\n if (block.timestamp >= nativeCurrencyRateTimestamp + MAXIMUM_RATE_AGE)\n revert NativeCurrencyRateIsStale();\n collateralAmount = safeCastToUint104(\n (bidAmount *\n uint256(int256(nativeCurrencyRateValue)) *\n collateralInBasisPoints) /\n uint256(int256(collateralRateValue)) /\n HUNDRED_PERCENT_IN_BASIS_POINTS\n );\n protocolFeeAmount = safeCastToUint104(\n (bidAmount *\n uint256(int256(nativeCurrencyRateValue)) *\n protocolFeeInBasisPoints) /\n uint256(int256(collateralRateValue)) /\n HUNDRED_PERCENT_IN_BASIS_POINTS\n );\n }\n\n /// @notice Sends value to recipient\n /// @dev In the contexts that this function is used, the balance will\n /// always be sufficient and thus is not checked\n /// @param recipient Recipient address\n /// @param amount Amount to be sent\n function sendValue(address payable recipient, uint256 amount) private {\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Transfer unsuccessful\");\n }\n\n /// @notice Safe-casts the value from uint256 to uint104\n /// @param valueInUint256 Value in uint256\n /// @return valueInUint104 Value safe-cast to uint256\n function safeCastToUint104(\n uint256 valueInUint256\n ) private pure returns (uint104 valueInUint104) {\n require(\n valueInUint256 <= type(uint104).max,\n \"Value does not fit in uint104\"\n );\n valueInUint104 = uint104(valueInUint256);\n }\n}\n" + }, + "contracts/api3-server-v1/OevDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./OevDataFeedServer.sol\";\nimport \"./DapiServer.sol\";\nimport \"./interfaces/IOevDapiServer.sol\";\n\n/// @title Contract that serves OEV dAPIs\ncontract OevDapiServer is OevDataFeedServer, DapiServer, IOevDapiServer {\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n ) DapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\n\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) internal view returns (int224 value, uint32 timestamp) {\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\n require(dataFeedId != bytes32(0), \"dAPI name not set\");\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\n dataFeedId\n ];\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\n } else {\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n require(timestamp > 0, \"Data feed not initialized\");\n }\n}\n" + }, + "contracts/api3-server-v1/OevDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IOevDataFeedServer.sol\";\nimport \"../vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol\";\nimport \"./proxies/interfaces/IOevProxy.sol\";\n\n/// @title Contract that serves OEV Beacons and Beacon sets\n/// @notice OEV Beacons and Beacon sets can be updated by the winner of the\n/// respective OEV auctions. The beneficiary can withdraw the proceeds from\n/// this contract.\ncontract OevDataFeedServer is DataFeedServer, IOevDataFeedServer {\n using ECDSA for bytes32;\n\n /// @notice Data feed with ID specific to the OEV proxy\n /// @dev This implies that an update as a result of an OEV auction only\n /// affects contracts that read through the respective proxy that the\n /// auction was being held for\n mapping(address => mapping(bytes32 => DataFeed))\n internal _oevProxyToIdToDataFeed;\n\n /// @notice Accumulated OEV auction proceeds for the specific proxy\n mapping(address => uint256) public override oevProxyToBalance;\n\n /// @notice Updates a data feed that the OEV proxy reads using the\n /// aggregation signed by the absolute majority of the respective Airnodes\n /// for the specific bid\n /// @dev For when the data feed being updated is a Beacon set, an absolute\n /// majority of the Airnodes that power the respective Beacons must sign\n /// the aggregated value and timestamp. While doing so, the Airnodes should\n /// refer to data signed to update an absolute majority of the respective\n /// Beacons. The Airnodes should require the data to be fresh enough (e.g.,\n /// at most 2 minutes-old), and tightly distributed around the resulting\n /// aggregation (e.g., within 1% deviation), and reject to provide an OEV\n /// proxy data feed update signature if these are not satisfied.\n /// @param oevProxy OEV proxy that reads the data feed\n /// @param dataFeedId Data feed ID\n /// @param updateId Update ID\n /// @param timestamp Signature timestamp\n /// @param data Update data (an `int256` encoded in contract ABI)\n /// @param packedOevUpdateSignatures Packed OEV update signatures, which\n /// include the Airnode address, template ID and these signed with the OEV\n /// update hash\n function updateOevProxyDataFeedWithSignedData(\n address oevProxy,\n bytes32 dataFeedId,\n bytes32 updateId,\n uint256 timestamp,\n bytes calldata data,\n bytes[] calldata packedOevUpdateSignatures\n ) external payable override onlyValidTimestamp(timestamp) {\n require(\n timestamp > _oevProxyToIdToDataFeed[oevProxy][dataFeedId].timestamp,\n \"Does not update timestamp\"\n );\n bytes32 oevUpdateHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n oevProxy,\n dataFeedId,\n updateId,\n timestamp,\n data,\n msg.sender,\n msg.value\n )\n );\n int224 updatedValue = decodeFulfillmentData(data);\n uint32 updatedTimestamp = uint32(timestamp);\n uint256 beaconCount = packedOevUpdateSignatures.length;\n if (beaconCount > 1) {\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\n uint256 validSignatureCount;\n for (uint256 ind = 0; ind < beaconCount; ) {\n bool signatureIsNotOmitted;\n (\n signatureIsNotOmitted,\n beaconIds[ind]\n ) = unpackAndValidateOevUpdateSignature(\n oevUpdateHash,\n packedOevUpdateSignatures[ind]\n );\n if (signatureIsNotOmitted) {\n unchecked {\n validSignatureCount++;\n }\n }\n unchecked {\n ind++;\n }\n }\n // \"Greater than or equal to\" is not enough because full control\n // of aggregation requires an absolute majority\n require(\n validSignatureCount > beaconCount / 2,\n \"Not enough signatures\"\n );\n require(\n dataFeedId == deriveBeaconSetId(beaconIds),\n \"Beacon set ID mismatch\"\n );\n emit UpdatedOevProxyBeaconSetWithSignedData(\n dataFeedId,\n oevProxy,\n updateId,\n updatedValue,\n updatedTimestamp\n );\n } else if (beaconCount == 1) {\n {\n (\n bool signatureIsNotOmitted,\n bytes32 beaconId\n ) = unpackAndValidateOevUpdateSignature(\n oevUpdateHash,\n packedOevUpdateSignatures[0]\n );\n require(signatureIsNotOmitted, \"Missing signature\");\n require(dataFeedId == beaconId, \"Beacon ID mismatch\");\n }\n emit UpdatedOevProxyBeaconWithSignedData(\n dataFeedId,\n oevProxy,\n updateId,\n updatedValue,\n updatedTimestamp\n );\n } else {\n revert(\"Did not specify any Beacons\");\n }\n _oevProxyToIdToDataFeed[oevProxy][dataFeedId] = DataFeed({\n value: updatedValue,\n timestamp: updatedTimestamp\n });\n oevProxyToBalance[oevProxy] += msg.value;\n }\n\n /// @notice Withdraws the balance of the OEV proxy to the respective\n /// beneficiary account\n /// @dev This does not require the caller to be the beneficiary because we\n /// expect that in most cases, the OEV beneficiary will be a contract that\n /// will not be able to make arbitrary calls. Our choice can be worked\n /// around by implementing a beneficiary proxy.\n /// @param oevProxy OEV proxy\n function withdraw(address oevProxy) external override {\n address oevBeneficiary = IOevProxy(oevProxy).oevBeneficiary();\n require(oevBeneficiary != address(0), \"Beneficiary address zero\");\n uint256 balance = oevProxyToBalance[oevProxy];\n require(balance != 0, \"OEV proxy balance zero\");\n oevProxyToBalance[oevProxy] = 0;\n emit Withdrew(oevProxy, oevBeneficiary, balance);\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = oevBeneficiary.call{value: balance}(\"\");\n require(success, \"Withdrawal reverted\");\n }\n\n /// @notice Reads the data feed as the OEV proxy with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) internal view returns (int224 value, uint32 timestamp) {\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\n dataFeedId\n ];\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\n } else {\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n require(timestamp > 0, \"Data feed not initialized\");\n }\n\n /// @notice Called privately to unpack and validate the OEV update\n /// signature\n /// @param oevUpdateHash OEV update hash\n /// @param packedOevUpdateSignature Packed OEV update signature, which\n /// includes the Airnode address, template ID and these signed with the OEV\n /// update hash\n /// @return signatureIsNotOmitted If the signature is omitted in\n /// `packedOevUpdateSignature`\n /// @return beaconId Beacon ID\n function unpackAndValidateOevUpdateSignature(\n bytes32 oevUpdateHash,\n bytes calldata packedOevUpdateSignature\n ) private pure returns (bool signatureIsNotOmitted, bytes32 beaconId) {\n (address airnode, bytes32 templateId, bytes memory signature) = abi\n .decode(packedOevUpdateSignature, (address, bytes32, bytes));\n beaconId = deriveBeaconId(airnode, templateId);\n if (signature.length != 0) {\n require(\n (\n keccak256(abi.encodePacked(oevUpdateHash, templateId))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n signatureIsNotOmitted = true;\n }\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DapiProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IDapiProxy.sol\";\nimport \"../interfaces/IApi3ServerV1.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific dAPI of\n/// a specific Api3ServerV1 contract\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev The proxy contracts are generalized to support most types of numerical\n/// data feeds. This means that the user of this proxy is expected to validate\n/// the read values according to the specific use-case. For example, `value` is\n/// a signed integer, yet it being negative may not make sense in the case that\n/// the data feed represents the spot price of an asset. In that case, the user\n/// is responsible with ensuring that `value` is not negative.\n/// In the case that the data feed is from a single source, `timestamp` is the\n/// system time of the Airnode when it signed the data. In the case that the\n/// data feed is from multiple sources, `timestamp` is the median of system\n/// times of the Airnodes when they signed the respective data. There are two\n/// points to consider while using `timestamp` in your contract logic: (1) It\n/// is based on the system time of the Airnodes, and not the block timestamp.\n/// This may be relevant when either of them drifts. (2) `timestamp` is an\n/// off-chain value that is being reported, similar to `value`. Both should\n/// only be trusted as much as the Airnode(s) that report them.\ncontract DapiProxy is IDapiProxy {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n /// @notice Hash of the dAPI name\n bytes32 public immutable override dapiNameHash;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dapiNameHash Hash of the dAPI name\n constructor(address _api3ServerV1, bytes32 _dapiNameHash) {\n api3ServerV1 = _api3ServerV1;\n dapiNameHash = _dapiNameHash;\n }\n\n /// @notice Reads the dAPI that this proxy maps to\n /// @return value dAPI value\n /// @return timestamp dAPI timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithDapiNameHash(dapiNameHash);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DapiProxyWithOev.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DapiProxy.sol\";\nimport \"./interfaces/IOevProxy.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific dAPI of\n/// a specific Api3ServerV1 contract and inform Api3ServerV1 about the\n/// beneficiary of the respective OEV proceeds\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DapiProxyWithOev is DapiProxy, IOevProxy {\n /// @notice OEV beneficiary address\n address public immutable override oevBeneficiary;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dapiNameHash Hash of the dAPI name\n /// @param _oevBeneficiary OEV beneficiary\n constructor(\n address _api3ServerV1,\n bytes32 _dapiNameHash,\n address _oevBeneficiary\n ) DapiProxy(_api3ServerV1, _dapiNameHash) {\n oevBeneficiary = _oevBeneficiary;\n }\n\n /// @notice Reads the dAPI that this proxy maps to\n /// @return value dAPI value\n /// @return timestamp dAPI timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DataFeedProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IDataFeedProxy.sol\";\nimport \"../interfaces/IApi3ServerV1.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific data\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DataFeedProxy is IDataFeedProxy {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n /// @notice Data feed ID\n bytes32 public immutable override dataFeedId;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\n constructor(address _api3ServerV1, bytes32 _dataFeedId) {\n api3ServerV1 = _api3ServerV1;\n dataFeedId = _dataFeedId;\n }\n\n /// @notice Reads the data feed that this proxy maps to\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1).readDataFeedWithId(\n dataFeedId\n );\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DataFeedProxyWithOev.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DataFeedProxy.sol\";\nimport \"./interfaces/IOevProxy.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific data\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract and inform\n/// Api3ServerV1 about the beneficiary of the respective OEV proceeds\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DataFeedProxyWithOev is DataFeedProxy, IOevProxy {\n /// @notice OEV beneficiary address\n address public immutable override oevBeneficiary;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\n /// @param _oevBeneficiary OEV beneficiary\n constructor(\n address _api3ServerV1,\n bytes32 _dataFeedId,\n address _oevBeneficiary\n ) DataFeedProxy(_api3ServerV1, _dataFeedId) {\n oevBeneficiary = _oevBeneficiary;\n }\n\n /// @notice Reads the data feed that this proxy maps to\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithIdAsOevProxy(dataFeedId);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IDapiProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IProxy.sol\";\n\ninterface IDapiProxy is IProxy {\n function dapiNameHash() external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IDataFeedProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IProxy.sol\";\n\ninterface IDataFeedProxy is IProxy {\n function dataFeedId() external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOevProxy {\n function oevBeneficiary() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @dev See DapiProxy.sol for comments about usage\ninterface IProxy {\n function read() external view returns (int224 value, uint32 timestamp);\n\n function api3ServerV1() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IProxyFactory {\n event DeployedDataFeedProxy(\n address indexed proxyAddress,\n bytes32 indexed dataFeedId,\n bytes metadata\n );\n\n event DeployedDapiProxy(\n address indexed proxyAddress,\n bytes32 indexed dapiName,\n bytes metadata\n );\n\n event DeployedDataFeedProxyWithOev(\n address indexed proxyAddress,\n bytes32 indexed dataFeedId,\n address oevBeneficiary,\n bytes metadata\n );\n\n event DeployedDapiProxyWithOev(\n address indexed proxyAddress,\n bytes32 indexed dapiName,\n address oevBeneficiary,\n bytes metadata\n );\n\n function deployDataFeedProxy(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDataFeedProxyWithOev(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function computeDataFeedProxyAddress(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDapiProxyAddress(\n bytes32 dapiName,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDataFeedProxyWithOevAddress(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDapiProxyWithOevAddress(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function api3ServerV1() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/mock/MockProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../interfaces/IProxy.sol\";\n\n// This contract is provided for testing purposes. It can be extended to mock\n// the interface of specific proxy types such as DataFeedProxy and DapiProxy.\ncontract MockProxy is IProxy {\n address public immutable override api3ServerV1;\n\n int224 private _value;\n\n uint32 private _timestamp;\n\n constructor(address _api3ServerV1) {\n api3ServerV1 = _api3ServerV1;\n }\n\n function read()\n external\n view\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = (_value, _timestamp);\n }\n\n function mock(int224 value, uint32 timestamp) external {\n (_value, _timestamp) = (value, timestamp);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/ProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DataFeedProxy.sol\";\nimport \"./DapiProxy.sol\";\nimport \"./DataFeedProxyWithOev.sol\";\nimport \"./DapiProxyWithOev.sol\";\nimport \"./interfaces/IProxyFactory.sol\";\nimport \"../../vendor/@openzeppelin/contracts@4.8.2/utils/Create2.sol\";\n\n/// @title Contract factory that deterministically deploys proxies that read\n/// data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV\n/// support\n/// @dev The proxies are deployed normally and not cloned to minimize the gas\n/// cost overhead while using them to read data feed values\ncontract ProxyFactory is IProxyFactory {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n constructor(address _api3ServerV1) {\n require(_api3ServerV1 != address(0), \"Api3ServerV1 address zero\");\n api3ServerV1 = _api3ServerV1;\n }\n\n /// @notice Deterministically deploys a data feed proxy\n /// @param dataFeedId Data feed ID\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDataFeedProxy(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n proxyAddress = address(\n new DataFeedProxy{salt: keccak256(metadata)}(\n api3ServerV1,\n dataFeedId\n )\n );\n emit DeployedDataFeedProxy(proxyAddress, dataFeedId, metadata);\n }\n\n /// @notice Deterministically deploys a dAPI proxy\n /// @param dapiName dAPI name\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n proxyAddress = address(\n new DapiProxy{salt: keccak256(metadata)}(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName))\n )\n );\n emit DeployedDapiProxy(proxyAddress, dapiName, metadata);\n }\n\n /// @notice Deterministically deploys a data feed proxy with OEV support\n /// @param dataFeedId Data feed ID\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDataFeedProxyWithOev(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = address(\n new DataFeedProxyWithOev{salt: keccak256(metadata)}(\n api3ServerV1,\n dataFeedId,\n oevBeneficiary\n )\n );\n emit DeployedDataFeedProxyWithOev(\n proxyAddress,\n dataFeedId,\n oevBeneficiary,\n metadata\n );\n }\n\n /// @notice Deterministically deploys a dAPI proxy with OEV support\n /// @param dapiName dAPI name\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = address(\n new DapiProxyWithOev{salt: keccak256(metadata)}(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName)),\n oevBeneficiary\n )\n );\n emit DeployedDapiProxyWithOev(\n proxyAddress,\n dapiName,\n oevBeneficiary,\n metadata\n );\n }\n\n /// @notice Computes the address of the data feed proxy\n /// @param dataFeedId Data feed ID\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDataFeedProxyAddress(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DataFeedProxy).creationCode,\n abi.encode(api3ServerV1, dataFeedId)\n )\n )\n );\n }\n\n /// @notice Computes the address of the dAPI proxy\n /// @param dapiName dAPI name\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDapiProxyAddress(\n bytes32 dapiName,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DapiProxy).creationCode,\n abi.encode(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName))\n )\n )\n )\n );\n }\n\n /// @notice Computes the address of the data feed proxy with OEV support\n /// @param dataFeedId Data feed ID\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDataFeedProxyWithOevAddress(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DataFeedProxyWithOev).creationCode,\n abi.encode(api3ServerV1, dataFeedId, oevBeneficiary)\n )\n )\n );\n }\n\n /// @notice Computes the address of the dAPI proxy with OEV support\n /// @param dapiName dAPI name\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDapiProxyWithOevAddress(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DapiProxyWithOev).creationCode,\n abi.encode(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName)),\n oevBeneficiary\n )\n )\n )\n );\n }\n}\n" + }, + "contracts/test/MockApi3ServerV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../api3-server-v1/Api3ServerV1.sol\";\n\ncontract MockApi3ServerV1 is Api3ServerV1 {\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n ) Api3ServerV1(_accessControlRegistry, _adminRoleDescription, _manager) {}\n\n function mockUpdate(\n bytes32 dataFeedId,\n int224 value,\n uint32 timestamp\n ) external {\n _dataFeeds[dataFeedId] = DataFeed({value: value, timestamp: timestamp});\n }\n}\n" + }, + "contracts/test/MockCallForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract MockCallForwarderTarget {\n string public storage1;\n uint256 public storage2;\n\n function payableTargetFunction(\n string calldata input1,\n uint256 input2,\n uint256 msgValue\n ) external payable returns (bytes memory output1, bool output2) {\n require(\n keccak256(abi.encodePacked(input1)) ==\n keccak256(abi.encodePacked(\"input1\")),\n \"Incorrect input\"\n );\n require(input2 == 123, \"Incorrect input\");\n require(msg.value == msgValue, \"Incorrect value\");\n storage1 = input1;\n storage2 = input2;\n output1 = hex\"12345678\";\n output2 = true;\n }\n\n function nonpayableTargetFunction(\n string calldata input1,\n uint256 input2\n ) external returns (bytes memory output1, bool output2) {\n require(\n keccak256(abi.encodePacked(input1)) ==\n keccak256(abi.encodePacked(\"input1\")),\n \"Incorrect input\"\n );\n require(input2 == 123, \"Incorrect input\");\n storage1 = input1;\n storage2 = input2;\n output1 = hex\"12345678\";\n output2 = true;\n }\n}\n" + }, + "contracts/test/MockContractWithNoDefaultPayable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ncontract MockContractWithNoDefaultPayable {\n function customPayable() external payable {}\n}\n" + }, + "contracts/test/MockMedian.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../api3-server-v1/aggregation/Median.sol\";\n\ncontract MockMedian is Median {\n function exposedMedian(\n int256[] memory array\n ) external pure returns (int256) {\n return median(array);\n }\n\n function exposedAverage(int256 x, int256 y) external pure returns (int256) {\n int256[] memory array = new int256[](2);\n if (x < y) {\n array[0] = x;\n array[1] = y;\n } else {\n array[0] = y;\n array[1] = x;\n }\n return median(array);\n }\n}\n" + }, + "contracts/test/MockMulticallTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ncontract MockMulticallTarget {\n error MyError(uint256 fieldAlways123, string fieldAlwaysFoo);\n\n int256[] private _argumentHistory;\n\n function alwaysRevertsWithString(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert(\"Reverted with string\");\n }\n\n function alwaysRevertsWithCustomError(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert MyError(123, \"Foo\");\n }\n\n function alwaysRevertsWithNoData(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert(); // solhint-disable-line reason-string\n }\n\n function convertsPositiveArgumentToNegative(\n int256 argPositive\n ) external payable returns (int256) {\n require(argPositive > 0, \"Argument not positive\");\n _argumentHistory.push(argPositive);\n return -argPositive;\n }\n\n function argumentHistory() external view returns (int256[] memory) {\n int256[] memory argumentHistoryInMemory = new int256[](\n _argumentHistory.length\n );\n for (uint256 ind = 0; ind < _argumentHistory.length; ind++) {\n argumentHistoryInMemory[ind] = _argumentHistory[ind];\n }\n return argumentHistoryInMemory;\n }\n}\n" + }, + "contracts/test/MockSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../utils/SelfMulticall.sol\";\nimport \"./MockMulticallTarget.sol\";\n\ncontract MockSelfMulticall is SelfMulticall, MockMulticallTarget {}\n" + }, + "contracts/test/MockSort.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../api3-server-v1/aggregation/Median.sol\";\n\ncontract MockSort is Sort {\n function exposedSort(\n int256[] memory array\n ) external pure returns (int256[] memory) {\n sort(array);\n return array;\n }\n}\n" + }, + "contracts/utils/ExtendedSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"./SelfMulticall.sol\";\nimport \"./interfaces/IExtendedSelfMulticall.sol\";\n\n/// @title Contract that extends SelfMulticall to fetch some of the global\n/// variables\n/// @notice Available global variables are limited to the ones that Airnode\n/// tends to need\ncontract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {\n /// @notice Returns the chain ID\n /// @return Chain ID\n function getChainId() external view override returns (uint256) {\n return block.chainid;\n }\n\n /// @notice Returns the account balance\n /// @param account Account address\n /// @return Account balance\n function getBalance(\n address account\n ) external view override returns (uint256) {\n return account.balance;\n }\n\n /// @notice Returns if the account contains bytecode\n /// @dev An account not containing any bytecode does not indicate that it\n /// is an EOA or it will not contain any bytecode in the future.\n /// Contract construction and `SELFDESTRUCT` updates the bytecode at the\n /// end of the transaction.\n /// @return If the account contains bytecode\n function containsBytecode(\n address account\n ) external view override returns (bool) {\n return account.code.length > 0;\n }\n\n /// @notice Returns the current block number\n /// @return Current block number\n function getBlockNumber() external view override returns (uint256) {\n return block.number;\n }\n\n /// @notice Returns the current block timestamp\n /// @return Current block timestamp\n function getBlockTimestamp() external view override returns (uint256) {\n return block.timestamp;\n }\n\n /// @notice Returns the current block basefee\n /// @return Current block basefee\n function getBlockBasefee() external view override returns (uint256) {\n return block.basefee;\n }\n}\n" + }, + "contracts/utils/interfaces/IExtendedSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./ISelfMulticall.sol\";\n\ninterface IExtendedSelfMulticall is ISelfMulticall {\n function getChainId() external view returns (uint256);\n\n function getBalance(address account) external view returns (uint256);\n\n function containsBytecode(address account) external view returns (bool);\n\n function getBlockNumber() external view returns (uint256);\n\n function getBlockTimestamp() external view returns (uint256);\n\n function getBlockBasefee() external view returns (uint256);\n}\n" + }, + "contracts/utils/interfaces/ISelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ISelfMulticall {\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory returndata);\n\n function tryMulticall(\n bytes[] calldata data\n ) external returns (bool[] memory successes, bytes[] memory returndata);\n}\n" + }, + "contracts/utils/SelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/ISelfMulticall.sol\";\n\n/// @title Contract that enables calls to the inheriting contract to be batched\n/// @notice Implements two ways of batching, one requires none of the calls to\n/// revert and the other tolerates individual calls reverting\n/// @dev This implementation uses delegatecall for individual function calls.\n/// Since delegatecall is a message call, it can only be made to functions that\n/// are externally visible. This means that a contract cannot multicall its own\n/// functions that use internal/private visibility modifiers.\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\ncontract SelfMulticall is ISelfMulticall {\n /// @notice Batches calls to the inheriting contract and reverts as soon as\n /// one of the batched calls reverts\n /// @param data Array of calldata of batched calls\n /// @return returndata Array of returndata of batched calls\n function multicall(\n bytes[] calldata data\n ) external override returns (bytes[] memory returndata) {\n uint256 callCount = data.length;\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n bool success;\n // solhint-disable-next-line avoid-low-level-calls\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\n if (!success) {\n bytes memory returndataWithRevertData = returndata[ind];\n if (returndataWithRevertData.length > 0) {\n // Adapted from OpenZeppelin's Address.sol\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndataWithRevertData)\n revert(\n add(32, returndataWithRevertData),\n returndata_size\n )\n }\n } else {\n revert(\"Multicall: No revert string\");\n }\n }\n unchecked {\n ind++;\n }\n }\n }\n\n /// @notice Batches calls to the inheriting contract but does not revert if\n /// any of the batched calls reverts\n /// @param data Array of calldata of batched calls\n /// @return successes Array of success conditions of batched calls\n /// @return returndata Array of returndata of batched calls\n function tryMulticall(\n bytes[] calldata data\n )\n external\n override\n returns (bool[] memory successes, bytes[] memory returndata)\n {\n uint256 callCount = data.length;\n successes = new bool[](callCount);\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n // solhint-disable-next-line avoid-low-level-calls\n (successes[ind], returndata[ind]) = address(this).delegatecall(\n data[ind]\n );\n unchecked {\n ind++;\n }\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/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" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/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" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/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" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(\n uint256 amount,\n bytes32 salt,\n bytes memory bytecode\n ) internal returns (address addr) {\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(\n bytes32 salt,\n bytes32 bytecodeHash,\n address deployer\n ) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.8.2/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (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 function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n mstore(0x1c, hash)\n message := keccak256(0x00, 0x3c)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, \"\\x19\\x01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n data := keccak256(ptr, 0x42)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\n * `validator` and `data` according to the version 0 of EIP-191.\n *\n * See {recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/cryptography/MerkleProof.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Calldata version of {verify}\n *\n * _Available since v4.7._\n */\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Calldata version of {processProof}\n *\n * _Available since v4.7._\n */\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Calldata version of {multiProofVerify}\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\n * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\n * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\n * respectively.\n *\n * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\n * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\n * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\n *\n * _Available since v4.7._\n */\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, \"MerkleProof: invalid multiproof\");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, \"MerkleProof: invalid multiproof\");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n require(value <= type(uint248).max, \"SafeCast: value doesn't fit in 248 bits\");\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n require(value <= type(uint240).max, \"SafeCast: value doesn't fit in 240 bits\");\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n require(value <= type(uint232).max, \"SafeCast: value doesn't fit in 232 bits\");\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.2._\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n require(value <= type(uint216).max, \"SafeCast: value doesn't fit in 216 bits\");\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n require(value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n require(value <= type(uint200).max, \"SafeCast: value doesn't fit in 200 bits\");\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n require(value <= type(uint192).max, \"SafeCast: value doesn't fit in 192 bits\");\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n require(value <= type(uint184).max, \"SafeCast: value doesn't fit in 184 bits\");\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n require(value <= type(uint176).max, \"SafeCast: value doesn't fit in 176 bits\");\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n require(value <= type(uint168).max, \"SafeCast: value doesn't fit in 168 bits\");\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n require(value <= type(uint160).max, \"SafeCast: value doesn't fit in 160 bits\");\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n require(value <= type(uint152).max, \"SafeCast: value doesn't fit in 152 bits\");\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n require(value <= type(uint144).max, \"SafeCast: value doesn't fit in 144 bits\");\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n require(value <= type(uint136).max, \"SafeCast: value doesn't fit in 136 bits\");\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v2.5._\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n require(value <= type(uint120).max, \"SafeCast: value doesn't fit in 120 bits\");\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n require(value <= type(uint112).max, \"SafeCast: value doesn't fit in 112 bits\");\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n require(value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.2._\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n require(value <= type(uint88).max, \"SafeCast: value doesn't fit in 88 bits\");\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n require(value <= type(uint80).max, \"SafeCast: value doesn't fit in 80 bits\");\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n require(value <= type(uint72).max, \"SafeCast: value doesn't fit in 72 bits\");\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v2.5._\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n require(value <= type(uint56).max, \"SafeCast: value doesn't fit in 56 bits\");\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n require(value <= type(uint48).max, \"SafeCast: value doesn't fit in 48 bits\");\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n require(value <= type(uint40).max, \"SafeCast: value doesn't fit in 40 bits\");\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v2.5._\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n require(value <= type(uint24).max, \"SafeCast: value doesn't fit in 24 bits\");\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v2.5._\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v2.5._\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n *\n * _Available since v3.0._\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.7._\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.7._\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n *\n * _Available since v3.0._\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "contracts/vendor/@openzeppelin/contracts@4.9.5/utils/structs/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 1000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/deployments/blast/.chainId b/deployments/blast/.chainId new file mode 100644 index 00000000..0b5f0e01 --- /dev/null +++ b/deployments/blast/.chainId @@ -0,0 +1 @@ +81457 \ No newline at end of file diff --git a/deployments/blast/AccessControlRegistry.json b/deployments/blast/AccessControlRegistry.json new file mode 100644 index 00000000..01cb82b2 --- /dev/null +++ b/deployments/blast/AccessControlRegistry.json @@ -0,0 +1,518 @@ +{ + "address": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "rootRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "manager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "InitializedManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "adminRole", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "description", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "InitializedRole", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "manager", + "type": "address" + } + ], + "name": "initializeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "adminRole", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "initializeRoleAndGrantToSender", + "outputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x034c8127d9f256509552a85b8e118539c142f9a269f0d94f71abc3b08d4ca0e4", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "1062014", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xa6f78953c3ba94cb0dcf1c746c75c512f1043080a3762d4d4f63c93099b07de2", + "transactionHash": "0x034c8127d9f256509552a85b8e118539c142f9a269f0d94f71abc3b08d4ca0e4", + "logs": [], + "blockNumber": 114753, + "cumulativeGasUsed": "1108971", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "16343b63dc5abcc6d4d0ea75eb689f42", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"rootRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"InitializedManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"adminRole\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"InitializedRole\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"}],\"name\":\"initializeManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"adminRole\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"initializeRoleAndGrantToSender\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Each user is called a \\\"manager\\\", and is the only member of their root role. Starting from this root role, they can create an arbitrary tree of roles and grant these to accounts. Each role has a description, and roles adminned by the same role cannot have the same description.\",\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initializeManager(address)\":{\"details\":\"Anyone can initialize a manager. An uninitialized manager attempting to initialize a role will be initialized automatically. Once a manager is initialized, subsequent initializations have no effect.\",\"params\":{\"manager\":\"Manager address to be initialized\"}},\"initializeRoleAndGrantToSender(bytes32,string)\":{\"details\":\"If the sender should not have the initialized role, they should explicitly renounce it after initializing it. Once a role is initialized, subsequent initializations have no effect other than granting the role to the sender. The sender must be a member of `adminRole`. `adminRole` value is not validated because the sender cannot have the `bytes32(0)` role. If the sender is an uninitialized manager that is initializing a role directly under their root role, manager initialization will happen automatically, which will grant the sender `adminRole` and allow them to initialize the role.\",\"params\":{\"adminRole\":\"Admin role to be assigned to the initialized role\",\"description\":\"Human-readable description of the initialized role\"},\"returns\":{\"role\":\"Initialized role\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"renounceRole(bytes32,address)\":{\"details\":\"Overriden to disallow managers from renouncing their root roles. `role` and `account` are not validated because `AccessControl.renounceRole` will revert if either of them is zero.\",\"params\":{\"account\":\"Account to renounce the role\",\"role\":\"Role to be renounced\"}},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}}},\"title\":\"Contract that allows users to manage independent, tree-shaped access control tables\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initializeManager(address)\":{\"notice\":\"Initializes the manager by initializing its root role and granting it to them\"},\"initializeRoleAndGrantToSender(bytes32,string)\":{\"notice\":\"Initializes a role by setting its admin role and grants it to the sender\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"renounceRole(bytes32,address)\":{\"notice\":\"Called by the account to renounce the role\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"}},\"notice\":\"Multiple contracts can refer to this contract to check if their users have granted accounts specific roles. Therefore, it aims to keep all access control roles of its users in this single contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access-control-registry/AccessControlRegistry.sol\":\"AccessControlRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/access-control-registry/AccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"../utils/SelfMulticall.sol\\\";\\nimport \\\"./RoleDeriver.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistry.sol\\\";\\n\\n/// @title Contract that allows users to manage independent, tree-shaped access\\n/// control tables\\n/// @notice Multiple contracts can refer to this contract to check if their\\n/// users have granted accounts specific roles. Therefore, it aims to keep all\\n/// access control roles of its users in this single contract.\\n/// @dev Each user is called a \\\"manager\\\", and is the only member of their root\\n/// role. Starting from this root role, they can create an arbitrary tree of\\n/// roles and grant these to accounts. Each role has a description, and roles\\n/// adminned by the same role cannot have the same description.\\ncontract AccessControlRegistry is\\n AccessControl,\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistry\\n{\\n /// @notice Initializes the manager by initializing its root role and\\n /// granting it to them\\n /// @dev Anyone can initialize a manager. An uninitialized manager\\n /// attempting to initialize a role will be initialized automatically.\\n /// Once a manager is initialized, subsequent initializations have no\\n /// effect.\\n /// @param manager Manager address to be initialized\\n function initializeManager(address manager) public override {\\n require(manager != address(0), \\\"Manager address zero\\\");\\n bytes32 rootRole = _deriveRootRole(manager);\\n if (!hasRole(rootRole, manager)) {\\n _grantRole(rootRole, manager);\\n emit InitializedManager(rootRole, manager, _msgSender());\\n }\\n }\\n\\n /// @notice Called by the account to renounce the role\\n /// @dev Overriden to disallow managers from renouncing their root roles.\\n /// `role` and `account` are not validated because\\n /// `AccessControl.renounceRole` will revert if either of them is zero.\\n /// @param role Role to be renounced\\n /// @param account Account to renounce the role\\n function renounceRole(\\n bytes32 role,\\n address account\\n ) public override(AccessControl, IAccessControl) {\\n require(\\n role != _deriveRootRole(account),\\n \\\"role is root role of account\\\"\\n );\\n AccessControl.renounceRole(role, account);\\n }\\n\\n /// @notice Initializes a role by setting its admin role and grants it to\\n /// the sender\\n /// @dev If the sender should not have the initialized role, they should\\n /// explicitly renounce it after initializing it.\\n /// Once a role is initialized, subsequent initializations have no effect\\n /// other than granting the role to the sender.\\n /// The sender must be a member of `adminRole`. `adminRole` value is not\\n /// validated because the sender cannot have the `bytes32(0)` role.\\n /// If the sender is an uninitialized manager that is initializing a role\\n /// directly under their root role, manager initialization will happen\\n /// automatically, which will grant the sender `adminRole` and allow them\\n /// to initialize the role.\\n /// @param adminRole Admin role to be assigned to the initialized role\\n /// @param description Human-readable description of the initialized role\\n /// @return role Initialized role\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external override returns (bytes32 role) {\\n require(bytes(description).length > 0, \\\"Role description empty\\\");\\n role = _deriveRole(adminRole, description);\\n // AccessControl roles have `DEFAULT_ADMIN_ROLE` (i.e., `bytes32(0)`)\\n // as their `adminRole` by default. No account in AccessControlRegistry\\n // can possibly have that role, which means all initialized roles will\\n // have non-default admin roles, and vice versa.\\n if (getRoleAdmin(role) == DEFAULT_ADMIN_ROLE) {\\n if (adminRole == _deriveRootRole(_msgSender())) {\\n initializeManager(_msgSender());\\n }\\n _setRoleAdmin(role, adminRole);\\n emit InitializedRole(role, adminRole, description, _msgSender());\\n }\\n grantRole(role, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xc098c5134e6ec70572976ff337b8cd03a39cd2874e15a0c7013c2417ebdd912d\",\"license\":\"MIT\"},\"contracts/access-control-registry/RoleDeriver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will derive\\n/// AccessControlRegistry roles\\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\\n/// derive roles, it should inherit this contract instead of re-implementing\\n/// the logic\\ncontract RoleDeriver {\\n /// @notice Derives the root role of the manager\\n /// @param manager Manager address\\n /// @return rootRole Root role\\n function _deriveRootRole(\\n address manager\\n ) internal pure returns (bytes32 rootRole) {\\n rootRole = keccak256(abi.encodePacked(manager));\\n }\\n\\n /// @notice Derives the role using its admin role and description\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param description Human-readable description of the role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n string memory description\\n ) internal pure returns (bytes32 role) {\\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\\n }\\n\\n /// @notice Derives the role using its admin role and description hash\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param descriptionHash Hash of the human-readable description of the\\n /// role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n bytes32 descriptionHash\\n ) internal pure returns (bytes32 role) {\\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\\n }\\n}\\n\",\"keccak256\":\"0x488adb3cb7031415d4a195230753a0ac8f9f610e6db7a571529a350e29c97ed6\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\\n event InitializedManager(\\n bytes32 indexed rootRole,\\n address indexed manager,\\n address sender\\n );\\n\\n event InitializedRole(\\n bytes32 indexed role,\\n bytes32 indexed adminRole,\\n string description,\\n address sender\\n );\\n\\n function initializeManager(address manager) external;\\n\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external returns (bytes32 role);\\n}\\n\",\"keccak256\":\"0xefd8f27ab9699aa6ed6dd9d13bbc79243af7134e6bf06f578d4bf542db79450c\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50611244806100206000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c806373e9836211610081578063a217fddf1161005b578063a217fddf146101cd578063ac9650d8146101d5578063d547741f146101f557600080fd5b806373e98362146101705780637f7120fe1461018357806391d148541461019657600080fd5b80632f2ff15d116100b25780632f2ff15d1461012757806336568abe1461013c578063437b91161461014f57600080fd5b806301ffc9a7146100ce578063248a9ca3146100f6575b600080fd5b6100e16100dc366004610d7b565b610208565b60405190151581526020015b60405180910390f35b610119610104366004610dbd565b60009081526020819052604090206001015490565b6040519081526020016100ed565b61013a610135366004610df2565b6102a1565b005b61013a61014a366004610df2565b6102cb565b61016261015d366004610e1e565b610364565b6040516100ed929190610f38565b61011961017e366004610f91565b6104ca565b61013a61019136600461100d565b610611565b6100e16101a4366004610df2565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610119600081565b6101e86101e3366004610e1e565b61071d565b6040516100ed9190611028565b61013a610203366004610df2565b61089e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061029b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152602081905260409020600101546102bc816108c3565b6102c683836108d0565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036103565760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b610360828261096e565b5050565b606080828067ffffffffffffffff8111156103815761038161103b565b6040519080825280602002602001820160405280156103aa578160200160208202803683370190505b5092508067ffffffffffffffff8111156103c6576103c661103b565b6040519080825280602002602001820160405280156103f957816020015b60608152602001906001900390816103e45790505b50915060005b818110156104c1573086868381811061041a5761041a611051565b905060200281019061042c9190611067565b60405161043a9291906110b5565b600060405180830381855af49150503d8060008114610475576040519150601f19603f3d011682016040523d82523d6000602084013e61047a565b606091505b5085838151811061048d5761048d611051565b602002602001018584815181106104a6576104a6611051565b602090810291909101019190915290151590526001016103ff565b50509250929050565b6000816105195760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161034d565b6105598484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506109f692505050565b60008181526020819052604090206001015490915061060057604080513360601b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012084036105b8576105b833610611565b6105c28185610a4b565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585336040516105f7939291906110c5565b60405180910390a35b61060a81336102a1565b9392505050565b6001600160a01b0381166106675760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161034d565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610360576106d181836108d0565b6001600160a01b038216817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d336040516001600160a01b03909116815260200160405180910390a35050565b6060818067ffffffffffffffff8111156107395761073961103b565b60405190808252806020026020018201604052801561076c57816020015b60608152602001906001900390816107575790505b50915060005b818110156108965760003086868481811061078f5761078f611051565b90506020028101906107a19190611067565b6040516107af9291906110b5565b600060405180830381855af49150503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b5085848151811061080257610802611051565b602090810291909101015290508061088d57600084838151811061082857610828611051565b602002602001015190506000815111156108455780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161034d565b50600101610772565b505092915050565b6000828152602081905260409020600101546108b9816108c3565b6102c68383610a96565b6108cd8133610b15565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610360576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561092a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146109ec5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161034d565b6103608282610a96565b600061060a8383604051602001610a0d9190611107565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610360576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661036057610b4681610b88565b610b51836020610b9a565b604051602001610b62929190611123565b60408051601f198184030181529082905262461bcd60e51b825261034d916004016111a4565b606061029b6001600160a01b03831660145b60606000610ba98360026111cd565b610bb49060026111e4565b67ffffffffffffffff811115610bcc57610bcc61103b565b6040519080825280601f01601f191660200182016040528015610bf6576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610c2d57610c2d611051565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610c7857610c78611051565b60200101906001600160f81b031916908160001a9053506000610c9c8460026111cd565b610ca79060016111e4565b90505b6001811115610d2c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610ce857610ce8611051565b1a60f81b828281518110610cfe57610cfe611051565b60200101906001600160f81b031916908160001a90535060049490941c93610d25816111f7565b9050610caa565b50831561060a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034d565b600060208284031215610d8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461060a57600080fd5b600060208284031215610dcf57600080fd5b5035919050565b80356001600160a01b0381168114610ded57600080fd5b919050565b60008060408385031215610e0557600080fd5b82359150610e1560208401610dd6565b90509250929050565b60008060208385031215610e3157600080fd5b823567ffffffffffffffff80821115610e4957600080fd5b818501915085601f830112610e5d57600080fd5b813581811115610e6c57600080fd5b8660208260051b8501011115610e8157600080fd5b60209290920196919550909350505050565b60005b83811015610eae578181015183820152602001610e96565b50506000910152565b60008151808452610ecf816020860160208601610e93565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610f2b578284038952610f19848351610eb7565b98850198935090840190600101610f01565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610f73578151151584529284019290840190600101610f55565b50505083810382850152610f878186610ee3565b9695505050505050565b600080600060408486031215610fa657600080fd5b83359250602084013567ffffffffffffffff80821115610fc557600080fd5b818601915086601f830112610fd957600080fd5b813581811115610fe857600080fd5b876020828501011115610ffa57600080fd5b6020830194508093505050509250925092565b60006020828403121561101f57600080fd5b61060a82610dd6565b60208152600061060a6020830184610ee3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261107e57600080fd5b83018035915067ffffffffffffffff82111561109957600080fd5b6020019150368190038213156110ae57600080fd5b9250929050565b8183823760009101908152919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611119818460208701610e93565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161115b816017850160208801610e93565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611198816028840160208801610e93565b01602801949350505050565b60208152600061060a6020830184610eb7565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029b5761029b6111b7565b8082018082111561029b5761029b6111b7565b600081611206576112066111b7565b50600019019056fea2646970667358221220ae4f3421aaad5b1af12510ac03d7ec2649209de4471e48601a849e44cc2f1d5864736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c806373e9836211610081578063a217fddf1161005b578063a217fddf146101cd578063ac9650d8146101d5578063d547741f146101f557600080fd5b806373e98362146101705780637f7120fe1461018357806391d148541461019657600080fd5b80632f2ff15d116100b25780632f2ff15d1461012757806336568abe1461013c578063437b91161461014f57600080fd5b806301ffc9a7146100ce578063248a9ca3146100f6575b600080fd5b6100e16100dc366004610d7b565b610208565b60405190151581526020015b60405180910390f35b610119610104366004610dbd565b60009081526020819052604090206001015490565b6040519081526020016100ed565b61013a610135366004610df2565b6102a1565b005b61013a61014a366004610df2565b6102cb565b61016261015d366004610e1e565b610364565b6040516100ed929190610f38565b61011961017e366004610f91565b6104ca565b61013a61019136600461100d565b610611565b6100e16101a4366004610df2565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610119600081565b6101e86101e3366004610e1e565b61071d565b6040516100ed9190611028565b61013a610203366004610df2565b61089e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061029b57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6000828152602081905260409020600101546102bc816108c3565b6102c683836108d0565b505050565b60408051606083901b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012082036103565760405162461bcd60e51b815260206004820152601c60248201527f726f6c6520697320726f6f7420726f6c65206f66206163636f756e740000000060448201526064015b60405180910390fd5b610360828261096e565b5050565b606080828067ffffffffffffffff8111156103815761038161103b565b6040519080825280602002602001820160405280156103aa578160200160208202803683370190505b5092508067ffffffffffffffff8111156103c6576103c661103b565b6040519080825280602002602001820160405280156103f957816020015b60608152602001906001900390816103e45790505b50915060005b818110156104c1573086868381811061041a5761041a611051565b905060200281019061042c9190611067565b60405161043a9291906110b5565b600060405180830381855af49150503d8060008114610475576040519150601f19603f3d011682016040523d82523d6000602084013e61047a565b606091505b5085838151811061048d5761048d611051565b602002602001018584815181106104a6576104a6611051565b602090810291909101019190915290151590526001016103ff565b50509250929050565b6000816105195760405162461bcd60e51b815260206004820152601660248201527f526f6c65206465736372697074696f6e20656d70747900000000000000000000604482015260640161034d565b6105598484848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506109f692505050565b60008181526020819052604090206001015490915061060057604080513360601b6bffffffffffffffffffffffff1916602080830191909152825160148184030181526034909201909252805191012084036105b8576105b833610611565b6105c28185610a4b565b83817f532ead3ec09896bef1351791fbaad86ac03f3204090a8e7f173f41414b1fdac08585336040516105f7939291906110c5565b60405180910390a35b61060a81336102a1565b9392505050565b6001600160a01b0381166106675760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640161034d565b604080516bffffffffffffffffffffffff19606084901b16602080830191909152825180830360140181526034909201835281519181019190912060008181528083528381206001600160a01b03861682529092529190205460ff16610360576106d181836108d0565b6001600160a01b038216817f875abd51165f03877e956b2e4342de31979d7dd8d271176cf24151278f355a1d336040516001600160a01b03909116815260200160405180910390a35050565b6060818067ffffffffffffffff8111156107395761073961103b565b60405190808252806020026020018201604052801561076c57816020015b60608152602001906001900390816107575790505b50915060005b818110156108965760003086868481811061078f5761078f611051565b90506020028101906107a19190611067565b6040516107af9291906110b5565b600060405180830381855af49150503d80600081146107ea576040519150601f19603f3d011682016040523d82523d6000602084013e6107ef565b606091505b5085848151811061080257610802611051565b602090810291909101015290508061088d57600084838151811061082857610828611051565b602002602001015190506000815111156108455780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e670000000000604482015260640161034d565b50600101610772565b505092915050565b6000828152602081905260409020600101546108b9816108c3565b6102c68383610a96565b6108cd8133610b15565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610360576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561092a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b03811633146109ec5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161034d565b6103608282610a96565b600061060a8383604051602001610a0d9190611107565b60408051601f198184030181528282528051602091820120838201949094528282019390935280518083038201815260609092019052805191012090565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610360576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661036057610b4681610b88565b610b51836020610b9a565b604051602001610b62929190611123565b60408051601f198184030181529082905262461bcd60e51b825261034d916004016111a4565b606061029b6001600160a01b03831660145b60606000610ba98360026111cd565b610bb49060026111e4565b67ffffffffffffffff811115610bcc57610bcc61103b565b6040519080825280601f01601f191660200182016040528015610bf6576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110610c2d57610c2d611051565b60200101906001600160f81b031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110610c7857610c78611051565b60200101906001600160f81b031916908160001a9053506000610c9c8460026111cd565b610ca79060016111e4565b90505b6001811115610d2c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110610ce857610ce8611051565b1a60f81b828281518110610cfe57610cfe611051565b60200101906001600160f81b031916908160001a90535060049490941c93610d25816111f7565b9050610caa565b50831561060a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161034d565b600060208284031215610d8d57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461060a57600080fd5b600060208284031215610dcf57600080fd5b5035919050565b80356001600160a01b0381168114610ded57600080fd5b919050565b60008060408385031215610e0557600080fd5b82359150610e1560208401610dd6565b90509250929050565b60008060208385031215610e3157600080fd5b823567ffffffffffffffff80821115610e4957600080fd5b818501915085601f830112610e5d57600080fd5b813581811115610e6c57600080fd5b8660208260051b8501011115610e8157600080fd5b60209290920196919550909350505050565b60005b83811015610eae578181015183820152602001610e96565b50506000910152565b60008151808452610ecf816020860160208601610e93565b601f01601f19169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015610f2b578284038952610f19848351610eb7565b98850198935090840190600101610f01565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015610f73578151151584529284019290840190600101610f55565b50505083810382850152610f878186610ee3565b9695505050505050565b600080600060408486031215610fa657600080fd5b83359250602084013567ffffffffffffffff80821115610fc557600080fd5b818601915086601f830112610fd957600080fd5b813581811115610fe857600080fd5b876020828501011115610ffa57600080fd5b6020830194508093505050509250925092565b60006020828403121561101f57600080fd5b61060a82610dd6565b60208152600061060a6020830184610ee3565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261107e57600080fd5b83018035915067ffffffffffffffff82111561109957600080fd5b6020019150368190038213156110ae57600080fd5b9250929050565b8183823760009101908152919050565b604081528260408201528284606083013760006060848301015260006060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b60008251611119818460208701610e93565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161115b816017850160208801610e93565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611198816028840160208801610e93565b01602801949350505050565b60208152600061060a6020830184610eb7565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761029b5761029b6111b7565b8082018082111561029b5761029b6111b7565b600081611206576112066111b7565b50600019019056fea2646970667358221220ae4f3421aaad5b1af12510ac03d7ec2649209de4471e48601a849e44cc2f1d5864736f6c63430008110033", + "devdoc": { + "details": "Each user is called a \"manager\", and is the only member of their root role. Starting from this root role, they can create an arbitrary tree of roles and grant these to accounts. Each role has a description, and roles adminned by the same role cannot have the same description.", + "kind": "dev", + "methods": { + "getRoleAdmin(bytes32)": { + "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." + }, + "grantRole(bytes32,address)": { + "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." + }, + "hasRole(bytes32,address)": { + "details": "Returns `true` if `account` has been granted `role`." + }, + "initializeManager(address)": { + "details": "Anyone can initialize a manager. An uninitialized manager attempting to initialize a role will be initialized automatically. Once a manager is initialized, subsequent initializations have no effect.", + "params": { + "manager": "Manager address to be initialized" + } + }, + "initializeRoleAndGrantToSender(bytes32,string)": { + "details": "If the sender should not have the initialized role, they should explicitly renounce it after initializing it. Once a role is initialized, subsequent initializations have no effect other than granting the role to the sender. The sender must be a member of `adminRole`. `adminRole` value is not validated because the sender cannot have the `bytes32(0)` role. If the sender is an uninitialized manager that is initializing a role directly under their root role, manager initialization will happen automatically, which will grant the sender `adminRole` and allow them to initialize the role.", + "params": { + "adminRole": "Admin role to be assigned to the initialized role", + "description": "Human-readable description of the initialized role" + }, + "returns": { + "role": "Initialized role" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "renounceRole(bytes32,address)": { + "details": "Overriden to disallow managers from renouncing their root roles. `role` and `account` are not validated because `AccessControl.renounceRole` will revert if either of them is zero.", + "params": { + "account": "Account to renounce the role", + "role": "Role to be renounced" + } + }, + "revokeRole(bytes32,address)": { + "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + } + }, + "title": "Contract that allows users to manage independent, tree-shaped access control tables", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "initializeManager(address)": { + "notice": "Initializes the manager by initializing its root role and granting it to them" + }, + "initializeRoleAndGrantToSender(bytes32,string)": { + "notice": "Initializes a role by setting its admin role and grants it to the sender" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "renounceRole(bytes32,address)": { + "notice": "Called by the account to renounce the role" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + } + }, + "notice": "Multiple contracts can refer to this contract to check if their users have granted accounts specific roles. Therefore, it aims to keep all access control roles of its users in this single contract.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 24, + "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", + "label": "_roles", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct AccessControl.RoleData)", + "numberOfBytes": "32", + "value": "t_struct(RoleData)19_storage" + }, + "t_struct(RoleData)19_storage": { + "encoding": "inplace", + "label": "struct AccessControl.RoleData", + "members": [ + { + "astId": 16, + "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", + "label": "members", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 18, + "contract": "contracts/access-control-registry/AccessControlRegistry.sol:AccessControlRegistry", + "label": "adminRole", + "offset": 0, + "slot": "1", + "type": "t_bytes32" + } + ], + "numberOfBytes": "64" + } + } + } +} diff --git a/deployments/blast/Api3ServerV1.json b/deployments/blast/Api3ServerV1.json new file mode 100644 index 00000000..6d4586e3 --- /dev/null +++ b/deployments/blast/Api3ServerV1.json @@ -0,0 +1,1137 @@ +{ + "address": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlRegistry", + "type": "address" + }, + { + "internalType": "string", + "name": "_adminRoleDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SetDapiName", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedBeaconSetWithBeacons", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedBeaconWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedOevProxyBeaconSetWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "name": "UpdatedOevProxyBeaconWithSignedData", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oevProxy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrew", + "type": "event" + }, + { + "inputs": [], + "name": "DAPI_NAME_SETTER_ROLE_DESCRIPTION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRoleDescription", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "containsBytecode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "dapiNameHashToDataFeedId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "dapiNameSetterRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + } + ], + "name": "dapiNameToDataFeedId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "dataFeeds", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "oevProxyToBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "oevProxyToIdToDataFeed", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiNameHash", + "type": "bytes32" + } + ], + "name": "readDataFeedWithDapiNameHash", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiNameHash", + "type": "bytes32" + } + ], + "name": "readDataFeedWithDapiNameHashAsOevProxy", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "readDataFeedWithId", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "readDataFeedWithIdAsOevProxy", + "outputs": [ + { + "internalType": "int224", + "name": "value", + "type": "int224" + }, + { + "internalType": "uint32", + "name": "timestamp", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + } + ], + "name": "setDapiName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "beaconIds", + "type": "bytes32[]" + } + ], + "name": "updateBeaconSetWithBeacons", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconSetId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "airnode", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "templateId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "updateBeaconWithSignedData", + "outputs": [ + { + "internalType": "bytes32", + "name": "beaconId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oevProxy", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "updateId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes[]", + "name": "packedOevUpdateSignatures", + "type": "bytes[]" + } + ], + "name": "updateOevProxyDataFeedWithSignedData", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oevProxy", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x94c8b133ac455b02f7161409987e2e8bfb85b327bd26dc0902c021e1832b5e69", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "2961690", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xaca74ee85b0466d9b21c0c0fa2428c9a181255bb70302cac12e22a31ebaf45b6", + "transactionHash": "0x94c8b133ac455b02f7161409987e2e8bfb85b327bd26dc0902c021e1832b5e69", + "logs": [], + "blockNumber": 114801, + "cumulativeGasUsed": "3025747", + "status": 1, + "byzantium": true + }, + "args": [ + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "Api3ServerV1 admin", + "0x81bc85f329cDB28936FbB239f734AE495121F9A6" + ], + "numDeployments": 1, + "solcInputHash": "16343b63dc5abcc6d4d0ea75eb689f42", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlRegistry\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_adminRoleDescription\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SetDapiName\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedBeaconSetWithBeacons\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedBeaconWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedOevProxyBeaconSetWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"name\":\"UpdatedOevProxyBeaconWithSignedData\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DAPI_NAME_SETTER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"containsBytecode\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"dapiNameHashToDataFeedId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dapiNameSetterRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"}],\"name\":\"dapiNameToDataFeedId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"dataFeeds\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"oevProxyToBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"oevProxyToIdToDataFeed\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiNameHash\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithDapiNameHash\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiNameHash\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithDapiNameHashAsOevProxy\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithId\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"readDataFeedWithIdAsOevProxy\",\"outputs\":[{\"internalType\":\"int224\",\"name\":\"value\",\"type\":\"int224\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"}],\"name\":\"setDapiName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"beaconIds\",\"type\":\"bytes32[]\"}],\"name\":\"updateBeaconSetWithBeacons\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconSetId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"airnode\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"templateId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"updateBeaconWithSignedData\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"beaconId\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"updateId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"bytes[]\",\"name\":\"packedOevUpdateSignatures\",\"type\":\"bytes[]\"}],\"name\":\"updateOevProxyDataFeedWithSignedData\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oevProxy\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\"}},\"containsBytecode(address)\":{\"details\":\"An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.\",\"returns\":{\"_0\":\"If the account contains bytecode\"}},\"dapiNameToDataFeedId(bytes32)\":{\"params\":{\"dapiName\":\"dAPI name\"},\"returns\":{\"_0\":\"Data feed ID\"}},\"getBalance(address)\":{\"params\":{\"account\":\"Account address\"},\"returns\":{\"_0\":\"Account balance\"}},\"getBlockBasefee()\":{\"returns\":{\"_0\":\"Current block basefee\"}},\"getBlockNumber()\":{\"returns\":{\"_0\":\"Current block number\"}},\"getBlockTimestamp()\":{\"returns\":{\"_0\":\"Current block timestamp\"}},\"getChainId()\":{\"returns\":{\"_0\":\"Chain ID\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"readDataFeedWithDapiNameHash(bytes32)\":{\"params\":{\"dapiNameHash\":\"dAPI name hash\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithDapiNameHashAsOevProxy(bytes32)\":{\"params\":{\"dapiNameHash\":\"dAPI name hash\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithId(bytes32)\":{\"params\":{\"dataFeedId\":\"Data feed ID\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"readDataFeedWithIdAsOevProxy(bytes32)\":{\"params\":{\"dataFeedId\":\"Data feed ID\"},\"returns\":{\"timestamp\":\"Data feed timestamp\",\"value\":\"Data feed value\"}},\"setDapiName(bytes32,bytes32)\":{\"details\":\"While a data feed ID refers to a specific Beacon or Beacon set, dAPI names provide a more abstract interface for convenience. This means a dAPI name that was pointing to a Beacon can be pointed to a Beacon set, then another Beacon set, etc.\",\"params\":{\"dapiName\":\"Human-readable dAPI name\",\"dataFeedId\":\"Data feed ID the dAPI name will point to\"}},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}},\"updateBeaconSetWithBeacons(bytes32[])\":{\"details\":\"As an oddity, this function still works if some of the IDs in `beaconIds` belong to Beacon sets rather than Beacons. This can be used to implement hierarchical Beacon sets.\",\"params\":{\"beaconIds\":\"Beacon IDs\"},\"returns\":{\"beaconSetId\":\"Beacon set ID\"}},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"details\":\"The signed data here is intentionally very general for practical reasons. It is less demanding on the signer to have data signed once and use that everywhere.\",\"params\":{\"airnode\":\"Airnode address\",\"data\":\"Update data (an `int256` encoded in contract ABI)\",\"signature\":\"Template ID, timestamp and the update data signed by the Airnode\",\"templateId\":\"Template ID\",\"timestamp\":\"Signature timestamp\"},\"returns\":{\"beaconId\":\"Updated Beacon ID\"}},\"updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])\":{\"details\":\"For when the data feed being updated is a Beacon set, an absolute majority of the Airnodes that power the respective Beacons must sign the aggregated value and timestamp. While doing so, the Airnodes should refer to data signed to update an absolute majority of the respective Beacons. The Airnodes should require the data to be fresh enough (e.g., at most 2 minutes-old), and tightly distributed around the resulting aggregation (e.g., within 1% deviation), and reject to provide an OEV proxy data feed update signature if these are not satisfied.\",\"params\":{\"data\":\"Update data (an `int256` encoded in contract ABI)\",\"dataFeedId\":\"Data feed ID\",\"oevProxy\":\"OEV proxy that reads the data feed\",\"packedOevUpdateSignatures\":\"Packed OEV update signatures, which include the Airnode address, template ID and these signed with the OEV update hash\",\"timestamp\":\"Signature timestamp\",\"updateId\":\"Update ID\"}},\"withdraw(address)\":{\"details\":\"This does not require the caller to be the beneficiary because we expect that in most cases, the OEV beneficiary will be a contract that will not be able to make arbitrary calls. Our choice can be worked around by implementing a beneficiary proxy.\",\"params\":{\"oevProxy\":\"OEV proxy\"}}},\"title\":\"First version of the contract that API3 uses to serve data feeds\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DAPI_NAME_SETTER_ROLE_DESCRIPTION()\":{\"notice\":\"dAPI name setter role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"containsBytecode(address)\":{\"notice\":\"Returns if the account contains bytecode\"},\"dapiNameHashToDataFeedId(bytes32)\":{\"notice\":\"dAPI name hash mapped to the data feed ID\"},\"dapiNameSetterRole()\":{\"notice\":\"dAPI name setter role\"},\"dapiNameToDataFeedId(bytes32)\":{\"notice\":\"Returns the data feed ID the dAPI name is set to\"},\"getBalance(address)\":{\"notice\":\"Returns the account balance\"},\"getBlockBasefee()\":{\"notice\":\"Returns the current block basefee\"},\"getBlockNumber()\":{\"notice\":\"Returns the current block number\"},\"getBlockTimestamp()\":{\"notice\":\"Returns the current block timestamp\"},\"getChainId()\":{\"notice\":\"Returns the chain ID\"},\"manager()\":{\"notice\":\"Address of the manager that manages the related AccessControlRegistry roles\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"oevProxyToBalance(address)\":{\"notice\":\"Accumulated OEV auction proceeds for the specific proxy\"},\"readDataFeedWithDapiNameHash(bytes32)\":{\"notice\":\"Reads the data feed with dAPI name hash\"},\"readDataFeedWithDapiNameHashAsOevProxy(bytes32)\":{\"notice\":\"Reads the data feed as the OEV proxy with dAPI name hash\"},\"readDataFeedWithId(bytes32)\":{\"notice\":\"Reads the data feed with ID\"},\"readDataFeedWithIdAsOevProxy(bytes32)\":{\"notice\":\"Reads the data feed as the OEV proxy with ID\"},\"setDapiName(bytes32,bytes32)\":{\"notice\":\"Sets the data feed ID the dAPI name points to\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"updateBeaconSetWithBeacons(bytes32[])\":{\"notice\":\"Updates the Beacon set using the current values of its Beacons\"},\"updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)\":{\"notice\":\"Updates a Beacon using data signed by the Airnode\"},\"updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])\":{\"notice\":\"Updates a data feed that the OEV proxy reads using the aggregation signed by the absolute majority of the respective Airnodes for the specific bid\"},\"withdraw(address)\":{\"notice\":\"Withdraws the balance of the OEV proxy to the respective beneficiary account\"}},\"notice\":\"Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets, dAPIs, with optional OEV support for all of these. The base Beacons are only updateable using signed data, and the Beacon sets are updateable based on the Beacons, optionally using PSP. OEV proxy Beacons and Beacon sets are updateable using OEV-signed data. Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/api3-server-v1/Api3ServerV1.sol\":\"Api3ServerV1\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xda898fa084aa1ddfdb346e6a40459e00a59d87071cce7c315a46d648dd71d0ba\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/access-control-registry/AccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/SelfMulticall.sol\\\";\\nimport \\\"./RoleDeriver.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistry.sol\\\";\\n\\n/// @title Contract to be inherited by contracts whose adminship functionality\\n/// will be implemented using AccessControlRegistry\\ncontract AccessControlRegistryAdminned is\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistryAdminned\\n{\\n /// @notice AccessControlRegistry contract address\\n address public immutable override accessControlRegistry;\\n\\n /// @notice Admin role description\\n string public override adminRoleDescription;\\n\\n bytes32 internal immutable adminRoleDescriptionHash;\\n\\n /// @dev Contracts deployed with the same admin role descriptions will have\\n /// the same roles, meaning that granting an account a role will authorize\\n /// it in multiple contracts. Unless you want your deployed contract to\\n /// share the role configuration of another contract, use a unique admin\\n /// role description.\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription\\n ) {\\n require(_accessControlRegistry != address(0), \\\"ACR address zero\\\");\\n require(\\n bytes(_adminRoleDescription).length > 0,\\n \\\"Admin role description empty\\\"\\n );\\n accessControlRegistry = _accessControlRegistry;\\n adminRoleDescription = _adminRoleDescription;\\n adminRoleDescriptionHash = keccak256(\\n abi.encodePacked(_adminRoleDescription)\\n );\\n }\\n\\n /// @notice Derives the admin role for the specific manager address\\n /// @param manager Manager address\\n /// @return adminRole Admin role\\n function _deriveAdminRole(\\n address manager\\n ) internal view returns (bytes32 adminRole) {\\n adminRole = _deriveRole(\\n _deriveRootRole(manager),\\n adminRoleDescriptionHash\\n );\\n }\\n}\\n\",\"keccak256\":\"0x813755d99a9d8dd6298720da68fb5a6dd69329ea2dec91da1d09f715d4543c15\",\"license\":\"MIT\"},\"contracts/access-control-registry/AccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./AccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\n/// @title Contract to be inherited by contracts with manager whose adminship\\n/// functionality will be implemented using AccessControlRegistry\\n/// @notice The manager address here is expected to belong to an\\n/// AccessControlRegistry user that is a multisig/DAO\\ncontract AccessControlRegistryAdminnedWithManager is\\n AccessControlRegistryAdminned,\\n IAccessControlRegistryAdminnedWithManager\\n{\\n /// @notice Address of the manager that manages the related\\n /// AccessControlRegistry roles\\n /// @dev The mutability of the manager role can be implemented by\\n /// designating an OwnableCallForwarder contract as the manager. The\\n /// ownership of this contract can then be transferred, effectively\\n /// transferring managership.\\n address public immutable override manager;\\n\\n /// @notice Admin role\\n /// @dev Since `manager` is immutable, so is `adminRole`\\n bytes32 public immutable override adminRole;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminned(\\n _accessControlRegistry,\\n _adminRoleDescription\\n )\\n {\\n require(_manager != address(0), \\\"Manager address zero\\\");\\n manager = _manager;\\n adminRole = _deriveAdminRole(_manager);\\n }\\n}\\n\",\"keccak256\":\"0xbe5df884327dd7d4e236c105b6ef52cc6db20b452f4cdbe6c50fa506ed66cace\",\"license\":\"MIT\"},\"contracts/access-control-registry/RoleDeriver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will derive\\n/// AccessControlRegistry roles\\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\\n/// derive roles, it should inherit this contract instead of re-implementing\\n/// the logic\\ncontract RoleDeriver {\\n /// @notice Derives the root role of the manager\\n /// @param manager Manager address\\n /// @return rootRole Root role\\n function _deriveRootRole(\\n address manager\\n ) internal pure returns (bytes32 rootRole) {\\n rootRole = keccak256(abi.encodePacked(manager));\\n }\\n\\n /// @notice Derives the role using its admin role and description\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param description Human-readable description of the role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n string memory description\\n ) internal pure returns (bytes32 role) {\\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\\n }\\n\\n /// @notice Derives the role using its admin role and description hash\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param descriptionHash Hash of the human-readable description of the\\n /// role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n bytes32 descriptionHash\\n ) internal pure returns (bytes32 role) {\\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\\n }\\n}\\n\",\"keccak256\":\"0x488adb3cb7031415d4a195230753a0ac8f9f610e6db7a571529a350e29c97ed6\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\\n event InitializedManager(\\n bytes32 indexed rootRole,\\n address indexed manager,\\n address sender\\n );\\n\\n event InitializedRole(\\n bytes32 indexed role,\\n bytes32 indexed adminRole,\\n string description,\\n address sender\\n );\\n\\n function initializeManager(address manager) external;\\n\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external returns (bytes32 role);\\n}\\n\",\"keccak256\":\"0xefd8f27ab9699aa6ed6dd9d13bbc79243af7134e6bf06f578d4bf542db79450c\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/api3-server-v1/Api3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./OevDapiServer.sol\\\";\\nimport \\\"./BeaconUpdatesWithSignedData.sol\\\";\\nimport \\\"./interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title First version of the contract that API3 uses to serve data feeds\\n/// @notice Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets,\\n/// dAPIs, with optional OEV support for all of these.\\n/// The base Beacons are only updateable using signed data, and the Beacon sets\\n/// are updateable based on the Beacons, optionally using PSP. OEV proxy\\n/// Beacons and Beacon sets are updateable using OEV-signed data.\\n/// Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\\ncontract Api3ServerV1 is\\n OevDapiServer,\\n BeaconUpdatesWithSignedData,\\n IApi3ServerV1\\n{\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n ) OevDapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\\n\\n /// @notice Reads the data feed with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithId(dataFeedId);\\n }\\n\\n /// @notice Reads the data feed with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithDapiNameHash(dapiNameHash);\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithIdAsOevProxy(dataFeedId);\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view override returns (int224 value, uint32 timestamp) {\\n return _readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\\n }\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view override returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _oevProxyToIdToDataFeed[proxy][dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0xa9100269a781dbc267a1de630d333b475efc13cc87bf906de23c21a972a03f41\",\"license\":\"MIT\"},\"contracts/api3-server-v1/BeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IBeaconUpdatesWithSignedData.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title Contract that updates Beacons using signed data\\ncontract BeaconUpdatesWithSignedData is\\n DataFeedServer,\\n IBeaconUpdatesWithSignedData\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Updates a Beacon using data signed by the Airnode\\n /// @dev The signed data here is intentionally very general for practical\\n /// reasons. It is less demanding on the signer to have data signed once\\n /// and use that everywhere.\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @param timestamp Signature timestamp\\n /// @param data Update data (an `int256` encoded in contract ABI)\\n /// @param signature Template ID, timestamp and the update data signed by\\n /// the Airnode\\n /// @return beaconId Updated Beacon ID\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external override returns (bytes32 beaconId) {\\n require(\\n (\\n keccak256(abi.encodePacked(templateId, timestamp, data))\\n .toEthSignedMessageHash()\\n ).recover(signature) == airnode,\\n \\\"Signature mismatch\\\"\\n );\\n beaconId = deriveBeaconId(airnode, templateId);\\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\\n emit UpdatedBeaconWithSignedData(\\n beaconId,\\n updatedValue,\\n uint32(timestamp)\\n );\\n }\\n}\\n\",\"keccak256\":\"0xbce2944dd193ddbf72c244bc49996c86badf092d9f852ba0db1852646d019cea\",\"license\":\"MIT\"},\"contracts/api3-server-v1/DapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IDapiServer.sol\\\";\\n\\n/// @title Contract that serves dAPIs mapped to Beacons and Beacon sets\\n/// @notice Beacons and Beacon sets are addressed by immutable IDs. Although\\n/// this is trust-minimized, it requires users to manage the ID of the data\\n/// feed they are using. For when the user does not want to do this, dAPIs can\\n/// be used as an abstraction layer. By using a dAPI, the user delegates this\\n/// responsibility to dAPI management. It is important for dAPI management to\\n/// be restricted by consensus rules (by using a multisig or a DAO) and similar\\n/// trustless security mechanisms.\\ncontract DapiServer is\\n AccessControlRegistryAdminnedWithManager,\\n DataFeedServer,\\n IDapiServer\\n{\\n /// @notice dAPI name setter role description\\n string public constant override DAPI_NAME_SETTER_ROLE_DESCRIPTION =\\n \\\"dAPI name setter\\\";\\n\\n /// @notice dAPI name setter role\\n bytes32 public immutable override dapiNameSetterRole;\\n\\n /// @notice dAPI name hash mapped to the data feed ID\\n mapping(bytes32 => bytes32) public override dapiNameHashToDataFeedId;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n dapiNameSetterRole = _deriveRole(\\n _deriveAdminRole(manager),\\n DAPI_NAME_SETTER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Sets the data feed ID the dAPI name points to\\n /// @dev While a data feed ID refers to a specific Beacon or Beacon set,\\n /// dAPI names provide a more abstract interface for convenience. This\\n /// means a dAPI name that was pointing to a Beacon can be pointed to a\\n /// Beacon set, then another Beacon set, etc.\\n /// @param dapiName Human-readable dAPI name\\n /// @param dataFeedId Data feed ID the dAPI name will point to\\n function setDapiName(\\n bytes32 dapiName,\\n bytes32 dataFeedId\\n ) external override {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n dapiNameSetterRole,\\n msg.sender\\n ),\\n \\\"Sender cannot set dAPI name\\\"\\n );\\n dapiNameHashToDataFeedId[\\n keccak256(abi.encodePacked(dapiName))\\n ] = dataFeedId;\\n emit SetDapiName(dataFeedId, dapiName, msg.sender);\\n }\\n\\n /// @notice Returns the data feed ID the dAPI name is set to\\n /// @param dapiName dAPI name\\n /// @return Data feed ID\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view override returns (bytes32) {\\n return dapiNameHashToDataFeedId[keccak256(abi.encodePacked(dapiName))];\\n }\\n\\n /// @notice Reads the data feed with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) internal view returns (int224 value, uint32 timestamp) {\\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\\n require(dataFeedId != bytes32(0), \\\"dAPI name not set\\\");\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n}\\n\",\"keccak256\":\"0xe494988a1868263fec06a6e5c639b18f2c17c9762e97e5c25d694a3af4dde12a\",\"license\":\"MIT\"},\"contracts/api3-server-v1/DataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../utils/ExtendedSelfMulticall.sol\\\";\\nimport \\\"./aggregation/Median.sol\\\";\\nimport \\\"./interfaces/IDataFeedServer.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title Contract that serves Beacons and Beacon sets\\n/// @notice A Beacon is a live data feed addressed by an ID, which is derived\\n/// from an Airnode address and a template ID. This is suitable where the more\\n/// recent data point is always more favorable, e.g., in the context of an\\n/// asset price data feed. Beacons can also be seen as one-Airnode data feeds\\n/// that can be used individually or combined to build Beacon sets.\\ncontract DataFeedServer is ExtendedSelfMulticall, Median, IDataFeedServer {\\n using ECDSA for bytes32;\\n\\n // Airnodes serve their fulfillment data along with timestamps. This\\n // contract casts the reported data to `int224` and the timestamp to\\n // `uint32`, which works until year 2106.\\n struct DataFeed {\\n int224 value;\\n uint32 timestamp;\\n }\\n\\n /// @notice Data feed with ID\\n mapping(bytes32 => DataFeed) internal _dataFeeds;\\n\\n /// @dev Reverts if the timestamp is from more than 1 hour in the future\\n modifier onlyValidTimestamp(uint256 timestamp) virtual {\\n unchecked {\\n require(\\n timestamp < block.timestamp + 1 hours,\\n \\\"Timestamp not valid\\\"\\n );\\n }\\n _;\\n }\\n\\n /// @notice Updates the Beacon set using the current values of its Beacons\\n /// @dev As an oddity, this function still works if some of the IDs in\\n /// `beaconIds` belong to Beacon sets rather than Beacons. This can be used\\n /// to implement hierarchical Beacon sets.\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Beacon set ID\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) public override returns (bytes32 beaconSetId) {\\n (int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(\\n beaconIds\\n );\\n beaconSetId = deriveBeaconSetId(beaconIds);\\n DataFeed storage beaconSet = _dataFeeds[beaconSetId];\\n if (beaconSet.timestamp == updatedTimestamp) {\\n require(\\n beaconSet.value != updatedValue,\\n \\\"Does not update Beacon set\\\"\\n );\\n }\\n _dataFeeds[beaconSetId] = DataFeed({\\n value: updatedValue,\\n timestamp: updatedTimestamp\\n });\\n emit UpdatedBeaconSetWithBeacons(\\n beaconSetId,\\n updatedValue,\\n updatedTimestamp\\n );\\n }\\n\\n /// @notice Reads the data feed with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithId(\\n bytes32 dataFeedId\\n ) internal view returns (int224 value, uint32 timestamp) {\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n\\n /// @notice Derives the Beacon ID from the Airnode address and template ID\\n /// @param airnode Airnode address\\n /// @param templateId Template ID\\n /// @return beaconId Beacon ID\\n function deriveBeaconId(\\n address airnode,\\n bytes32 templateId\\n ) internal pure returns (bytes32 beaconId) {\\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\\n }\\n\\n /// @notice Derives the Beacon set ID from the Beacon IDs\\n /// @dev Notice that `abi.encode()` is used over `abi.encodePacked()`\\n /// @param beaconIds Beacon IDs\\n /// @return beaconSetId Beacon set ID\\n function deriveBeaconSetId(\\n bytes32[] memory beaconIds\\n ) internal pure returns (bytes32 beaconSetId) {\\n beaconSetId = keccak256(abi.encode(beaconIds));\\n }\\n\\n /// @notice Called privately to process the Beacon update\\n /// @param beaconId Beacon ID\\n /// @param timestamp Timestamp used in the signature\\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\\n /// @return updatedBeaconValue Updated Beacon value\\n function processBeaconUpdate(\\n bytes32 beaconId,\\n uint256 timestamp,\\n bytes calldata data\\n )\\n internal\\n onlyValidTimestamp(timestamp)\\n returns (int224 updatedBeaconValue)\\n {\\n updatedBeaconValue = decodeFulfillmentData(data);\\n require(\\n timestamp > _dataFeeds[beaconId].timestamp,\\n \\\"Does not update timestamp\\\"\\n );\\n _dataFeeds[beaconId] = DataFeed({\\n value: updatedBeaconValue,\\n timestamp: uint32(timestamp)\\n });\\n }\\n\\n /// @notice Called privately to decode the fulfillment data\\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\\n /// @return decodedData Decoded fulfillment data\\n function decodeFulfillmentData(\\n bytes memory data\\n ) internal pure returns (int224) {\\n require(data.length == 32, \\\"Data length not correct\\\");\\n int256 decodedData = abi.decode(data, (int256));\\n require(\\n decodedData >= type(int224).min && decodedData <= type(int224).max,\\n \\\"Value typecasting error\\\"\\n );\\n return int224(decodedData);\\n }\\n\\n /// @notice Called privately to aggregate the Beacons and return the result\\n /// @param beaconIds Beacon IDs\\n /// @return value Aggregation value\\n /// @return timestamp Aggregation timestamp\\n function aggregateBeacons(\\n bytes32[] memory beaconIds\\n ) internal view returns (int224 value, uint32 timestamp) {\\n uint256 beaconCount = beaconIds.length;\\n require(beaconCount > 1, \\\"Specified less than two Beacons\\\");\\n int256[] memory values = new int256[](beaconCount);\\n int256[] memory timestamps = new int256[](beaconCount);\\n for (uint256 ind = 0; ind < beaconCount; ) {\\n DataFeed storage dataFeed = _dataFeeds[beaconIds[ind]];\\n values[ind] = dataFeed.value;\\n timestamps[ind] = int256(uint256(dataFeed.timestamp));\\n unchecked {\\n ind++;\\n }\\n }\\n value = int224(median(values));\\n timestamp = uint32(uint256(median(timestamps)));\\n }\\n}\\n\",\"keccak256\":\"0x40e1c23fb4fde07d21df91e942dc7199428f9927f041951d0609fad5f9c54f5a\",\"license\":\"MIT\"},\"contracts/api3-server-v1/OevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./OevDataFeedServer.sol\\\";\\nimport \\\"./DapiServer.sol\\\";\\nimport \\\"./interfaces/IOevDapiServer.sol\\\";\\n\\n/// @title Contract that serves OEV dAPIs\\ncontract OevDapiServer is OevDataFeedServer, DapiServer, IOevDapiServer {\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n ) DapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\\n\\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\\n /// @param dapiNameHash dAPI name hash\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) internal view returns (int224 value, uint32 timestamp) {\\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\\n require(dataFeedId != bytes32(0), \\\"dAPI name not set\\\");\\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\\n dataFeedId\\n ];\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\\n } else {\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n}\\n\",\"keccak256\":\"0x7e506b1a9248563d4873159a40e5c2ce46ad0e24ad833d62610669a7dea8f137\",\"license\":\"MIT\"},\"contracts/api3-server-v1/OevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"./DataFeedServer.sol\\\";\\nimport \\\"./interfaces/IOevDataFeedServer.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"./proxies/interfaces/IOevProxy.sol\\\";\\n\\n/// @title Contract that serves OEV Beacons and Beacon sets\\n/// @notice OEV Beacons and Beacon sets can be updated by the winner of the\\n/// respective OEV auctions. The beneficiary can withdraw the proceeds from\\n/// this contract.\\ncontract OevDataFeedServer is DataFeedServer, IOevDataFeedServer {\\n using ECDSA for bytes32;\\n\\n /// @notice Data feed with ID specific to the OEV proxy\\n /// @dev This implies that an update as a result of an OEV auction only\\n /// affects contracts that read through the respective proxy that the\\n /// auction was being held for\\n mapping(address => mapping(bytes32 => DataFeed))\\n internal _oevProxyToIdToDataFeed;\\n\\n /// @notice Accumulated OEV auction proceeds for the specific proxy\\n mapping(address => uint256) public override oevProxyToBalance;\\n\\n /// @notice Updates a data feed that the OEV proxy reads using the\\n /// aggregation signed by the absolute majority of the respective Airnodes\\n /// for the specific bid\\n /// @dev For when the data feed being updated is a Beacon set, an absolute\\n /// majority of the Airnodes that power the respective Beacons must sign\\n /// the aggregated value and timestamp. While doing so, the Airnodes should\\n /// refer to data signed to update an absolute majority of the respective\\n /// Beacons. The Airnodes should require the data to be fresh enough (e.g.,\\n /// at most 2 minutes-old), and tightly distributed around the resulting\\n /// aggregation (e.g., within 1% deviation), and reject to provide an OEV\\n /// proxy data feed update signature if these are not satisfied.\\n /// @param oevProxy OEV proxy that reads the data feed\\n /// @param dataFeedId Data feed ID\\n /// @param updateId Update ID\\n /// @param timestamp Signature timestamp\\n /// @param data Update data (an `int256` encoded in contract ABI)\\n /// @param packedOevUpdateSignatures Packed OEV update signatures, which\\n /// include the Airnode address, template ID and these signed with the OEV\\n /// update hash\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable override onlyValidTimestamp(timestamp) {\\n require(\\n timestamp > _oevProxyToIdToDataFeed[oevProxy][dataFeedId].timestamp,\\n \\\"Does not update timestamp\\\"\\n );\\n bytes32 oevUpdateHash = keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n oevProxy,\\n dataFeedId,\\n updateId,\\n timestamp,\\n data,\\n msg.sender,\\n msg.value\\n )\\n );\\n int224 updatedValue = decodeFulfillmentData(data);\\n uint32 updatedTimestamp = uint32(timestamp);\\n uint256 beaconCount = packedOevUpdateSignatures.length;\\n if (beaconCount > 1) {\\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\\n uint256 validSignatureCount;\\n for (uint256 ind = 0; ind < beaconCount; ) {\\n bool signatureIsNotOmitted;\\n (\\n signatureIsNotOmitted,\\n beaconIds[ind]\\n ) = unpackAndValidateOevUpdateSignature(\\n oevUpdateHash,\\n packedOevUpdateSignatures[ind]\\n );\\n if (signatureIsNotOmitted) {\\n unchecked {\\n validSignatureCount++;\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n // \\\"Greater than or equal to\\\" is not enough because full control\\n // of aggregation requires an absolute majority\\n require(\\n validSignatureCount > beaconCount / 2,\\n \\\"Not enough signatures\\\"\\n );\\n require(\\n dataFeedId == deriveBeaconSetId(beaconIds),\\n \\\"Beacon set ID mismatch\\\"\\n );\\n emit UpdatedOevProxyBeaconSetWithSignedData(\\n dataFeedId,\\n oevProxy,\\n updateId,\\n updatedValue,\\n updatedTimestamp\\n );\\n } else if (beaconCount == 1) {\\n {\\n (\\n bool signatureIsNotOmitted,\\n bytes32 beaconId\\n ) = unpackAndValidateOevUpdateSignature(\\n oevUpdateHash,\\n packedOevUpdateSignatures[0]\\n );\\n require(signatureIsNotOmitted, \\\"Missing signature\\\");\\n require(dataFeedId == beaconId, \\\"Beacon ID mismatch\\\");\\n }\\n emit UpdatedOevProxyBeaconWithSignedData(\\n dataFeedId,\\n oevProxy,\\n updateId,\\n updatedValue,\\n updatedTimestamp\\n );\\n } else {\\n revert(\\\"Did not specify any Beacons\\\");\\n }\\n _oevProxyToIdToDataFeed[oevProxy][dataFeedId] = DataFeed({\\n value: updatedValue,\\n timestamp: updatedTimestamp\\n });\\n oevProxyToBalance[oevProxy] += msg.value;\\n }\\n\\n /// @notice Withdraws the balance of the OEV proxy to the respective\\n /// beneficiary account\\n /// @dev This does not require the caller to be the beneficiary because we\\n /// expect that in most cases, the OEV beneficiary will be a contract that\\n /// will not be able to make arbitrary calls. Our choice can be worked\\n /// around by implementing a beneficiary proxy.\\n /// @param oevProxy OEV proxy\\n function withdraw(address oevProxy) external override {\\n address oevBeneficiary = IOevProxy(oevProxy).oevBeneficiary();\\n require(oevBeneficiary != address(0), \\\"Beneficiary address zero\\\");\\n uint256 balance = oevProxyToBalance[oevProxy];\\n require(balance != 0, \\\"OEV proxy balance zero\\\");\\n oevProxyToBalance[oevProxy] = 0;\\n emit Withdrew(oevProxy, oevBeneficiary, balance);\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, ) = oevBeneficiary.call{value: balance}(\\\"\\\");\\n require(success, \\\"Withdrawal reverted\\\");\\n }\\n\\n /// @notice Reads the data feed as the OEV proxy with ID\\n /// @param dataFeedId Data feed ID\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function _readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) internal view returns (int224 value, uint32 timestamp) {\\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\\n dataFeedId\\n ];\\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\\n } else {\\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\\n }\\n require(timestamp > 0, \\\"Data feed not initialized\\\");\\n }\\n\\n /// @notice Called privately to unpack and validate the OEV update\\n /// signature\\n /// @param oevUpdateHash OEV update hash\\n /// @param packedOevUpdateSignature Packed OEV update signature, which\\n /// includes the Airnode address, template ID and these signed with the OEV\\n /// update hash\\n /// @return signatureIsNotOmitted If the signature is omitted in\\n /// `packedOevUpdateSignature`\\n /// @return beaconId Beacon ID\\n function unpackAndValidateOevUpdateSignature(\\n bytes32 oevUpdateHash,\\n bytes calldata packedOevUpdateSignature\\n ) private pure returns (bool signatureIsNotOmitted, bytes32 beaconId) {\\n (address airnode, bytes32 templateId, bytes memory signature) = abi\\n .decode(packedOevUpdateSignature, (address, bytes32, bytes));\\n beaconId = deriveBeaconId(airnode, templateId);\\n if (signature.length != 0) {\\n require(\\n (\\n keccak256(abi.encodePacked(oevUpdateHash, templateId))\\n .toEthSignedMessageHash()\\n ).recover(signature) == airnode,\\n \\\"Signature mismatch\\\"\\n );\\n signatureIsNotOmitted = true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc1e5638651d93ca1629aa75c5376039f453330cf6d1305ed190f71eeca9a192c\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/Median.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./Sort.sol\\\";\\nimport \\\"./QuickSelect.sol\\\";\\n\\n/// @title Contract to be inherited by contracts that will calculate the median\\n/// of an array\\n/// @notice The operation will be in-place, i.e., the array provided as the\\n/// argument will be modified.\\ncontract Median is Sort, Quickselect {\\n /// @notice Returns the median of the array\\n /// @dev Uses an unrolled sorting implementation for shorter arrays and\\n /// quickselect for longer arrays for gas cost efficiency\\n /// @param array Array whose median is to be calculated\\n /// @return Median of the array\\n function median(int256[] memory array) internal pure returns (int256) {\\n uint256 arrayLength = array.length;\\n if (arrayLength <= MAX_SORT_LENGTH) {\\n sort(array);\\n if (arrayLength % 2 == 1) {\\n return array[arrayLength / 2];\\n } else {\\n assert(arrayLength != 0);\\n unchecked {\\n return\\n average(\\n array[arrayLength / 2 - 1],\\n array[arrayLength / 2]\\n );\\n }\\n }\\n } else {\\n if (arrayLength % 2 == 1) {\\n return array[quickselectK(array, arrayLength / 2)];\\n } else {\\n uint256 mid1;\\n uint256 mid2;\\n unchecked {\\n (mid1, mid2) = quickselectKPlusOne(\\n array,\\n arrayLength / 2 - 1\\n );\\n }\\n return average(array[mid1], array[mid2]);\\n }\\n }\\n }\\n\\n /// @notice Averages two signed integers without overflowing\\n /// @param x Integer x\\n /// @param y Integer y\\n /// @return Average of integers x and y\\n function average(int256 x, int256 y) private pure returns (int256) {\\n unchecked {\\n int256 averageRoundedDownToNegativeInfinity = (x >> 1) +\\n (y >> 1) +\\n (x & y & 1);\\n // If the average rounded down to negative infinity is negative\\n // (i.e., its 256th sign bit is set), and one of (x, y) is even and\\n // the other one is odd (i.e., the 1st bit of their xor is set),\\n // add 1 to round the average down to zero instead.\\n // We will typecast the signed integer to unsigned to logical-shift\\n // int256(uint256(signedInt)) >> 255 ~= signedInt >>> 255\\n return\\n averageRoundedDownToNegativeInfinity +\\n (int256(\\n (uint256(averageRoundedDownToNegativeInfinity) >> 255)\\n ) & (x ^ y));\\n }\\n }\\n}\\n\",\"keccak256\":\"0x84912d10ad5fa4848f2dfbbac40431ccdeb5250c263718b5fbdfeceeb0946524\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/QuickSelect.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will calculate the index\\n/// of the k-th and optionally (k+1)-th largest elements in the array\\n/// @notice Uses quickselect, which operates in-place, i.e., the array provided\\n/// as the argument will be modified.\\ncontract Quickselect {\\n /// @notice Returns the index of the k-th largest element in the array\\n /// @param array Array in which k-th largest element will be searched\\n /// @param k K\\n /// @return indK Index of the k-th largest element\\n function quickselectK(\\n int256[] memory array,\\n uint256 k\\n ) internal pure returns (uint256 indK) {\\n uint256 arrayLength = array.length;\\n assert(arrayLength > 0);\\n unchecked {\\n (indK, ) = quickselect(array, 0, arrayLength - 1, k, false);\\n }\\n }\\n\\n /// @notice Returns the index of the k-th and (k+1)-th largest elements in\\n /// the array\\n /// @param array Array in which k-th and (k+1)-th largest elements will be\\n /// searched\\n /// @param k K\\n /// @return indK Index of the k-th largest element\\n /// @return indKPlusOne Index of the (k+1)-th largest element\\n function quickselectKPlusOne(\\n int256[] memory array,\\n uint256 k\\n ) internal pure returns (uint256 indK, uint256 indKPlusOne) {\\n uint256 arrayLength = array.length;\\n assert(arrayLength > 1);\\n unchecked {\\n (indK, indKPlusOne) = quickselect(\\n array,\\n 0,\\n arrayLength - 1,\\n k,\\n true\\n );\\n }\\n }\\n\\n /// @notice Returns the index of the k-th largest element in the specified\\n /// section of the (potentially unsorted) array\\n /// @param array Array in which K will be searched for\\n /// @param lo Starting index of the section of the array that K will be\\n /// searched in\\n /// @param hi Last index of the section of the array that K will be\\n /// searched in\\n /// @param k K\\n /// @param selectKPlusOne If the index of the (k+1)-th largest element is\\n /// to be returned\\n /// @return indK Index of the k-th largest element\\n /// @return indKPlusOne Index of the (k+1)-th largest element (only set if\\n /// `selectKPlusOne` is `true`)\\n function quickselect(\\n int256[] memory array,\\n uint256 lo,\\n uint256 hi,\\n uint256 k,\\n bool selectKPlusOne\\n ) private pure returns (uint256 indK, uint256 indKPlusOne) {\\n if (lo == hi) {\\n return (k, 0);\\n }\\n uint256 indPivot = partition(array, lo, hi);\\n if (k < indPivot) {\\n unchecked {\\n (indK, ) = quickselect(array, lo, indPivot - 1, k, false);\\n }\\n } else if (k > indPivot) {\\n unchecked {\\n (indK, ) = quickselect(array, indPivot + 1, hi, k, false);\\n }\\n } else {\\n indK = indPivot;\\n }\\n // Since Quickselect ends in the array being partitioned around the\\n // k-th largest element, we can continue searching towards right for\\n // the (k+1)-th largest element, which is useful in calculating the\\n // median of an array with even length\\n if (selectKPlusOne) {\\n unchecked {\\n indKPlusOne = indK + 1;\\n }\\n uint256 i;\\n unchecked {\\n i = indKPlusOne + 1;\\n }\\n uint256 arrayLength = array.length;\\n for (; i < arrayLength; ) {\\n if (array[i] < array[indKPlusOne]) {\\n indKPlusOne = i;\\n }\\n unchecked {\\n i++;\\n }\\n }\\n }\\n }\\n\\n /// @notice Partitions the array into two around a pivot\\n /// @param array Array that will be partitioned\\n /// @param lo Starting index of the section of the array that will be\\n /// partitioned\\n /// @param hi Last index of the section of the array that will be\\n /// partitioned\\n /// @return pivotInd Pivot index\\n function partition(\\n int256[] memory array,\\n uint256 lo,\\n uint256 hi\\n ) private pure returns (uint256 pivotInd) {\\n if (lo == hi) {\\n return lo;\\n }\\n int256 pivot = array[lo];\\n uint256 i = lo;\\n unchecked {\\n pivotInd = hi + 1;\\n }\\n while (true) {\\n do {\\n unchecked {\\n i++;\\n }\\n } while (i < array.length && array[i] < pivot);\\n do {\\n unchecked {\\n pivotInd--;\\n }\\n } while (array[pivotInd] > pivot);\\n if (i >= pivotInd) {\\n (array[lo], array[pivotInd]) = (array[pivotInd], array[lo]);\\n return pivotInd;\\n }\\n (array[i], array[pivotInd]) = (array[pivotInd], array[i]);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7f458dd165fed89866c5fe626e3df3c9bf6884498ec1233f4083615084521d6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/aggregation/Sort.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will sort an array using\\n/// an unrolled implementation\\n/// @notice The operation will be in-place, i.e., the array provided as the\\n/// argument will be modified.\\ncontract Sort {\\n uint256 internal constant MAX_SORT_LENGTH = 9;\\n\\n /// @notice Sorts the array\\n /// @param array Array to be sorted\\n function sort(int256[] memory array) internal pure {\\n uint256 arrayLength = array.length;\\n require(arrayLength <= MAX_SORT_LENGTH, \\\"Array too long to sort\\\");\\n // Do a binary search\\n if (arrayLength < 6) {\\n // Possible lengths: 1, 2, 3, 4, 5\\n if (arrayLength < 4) {\\n // Possible lengths: 1, 2, 3\\n if (arrayLength == 3) {\\n // Length: 3\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 0, 1);\\n } else if (arrayLength == 2) {\\n // Length: 2\\n swapIfFirstIsLarger(array, 0, 1);\\n }\\n // Do nothing for Length: 1\\n } else {\\n // Possible lengths: 4, 5\\n if (arrayLength == 5) {\\n // Length: 5\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 1, 2);\\n } else {\\n // Length: 4\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 1, 2);\\n }\\n }\\n } else {\\n // Possible lengths: 6, 7, 8, 9\\n if (arrayLength < 8) {\\n // Possible lengths: 6, 7\\n if (arrayLength == 7) {\\n // Length: 7\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 4, 6);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 2, 6);\\n swapIfFirstIsLarger(array, 1, 5);\\n swapIfFirstIsLarger(array, 0, 4);\\n swapIfFirstIsLarger(array, 2, 5);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n } else {\\n // Length: 6\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 2, 3);\\n }\\n } else {\\n // Possible lengths: 8, 9\\n if (arrayLength == 9) {\\n // Length: 9\\n swapIfFirstIsLarger(array, 1, 8);\\n swapIfFirstIsLarger(array, 2, 7);\\n swapIfFirstIsLarger(array, 3, 6);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 1, 4);\\n swapIfFirstIsLarger(array, 5, 8);\\n swapIfFirstIsLarger(array, 0, 2);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 2, 6);\\n swapIfFirstIsLarger(array, 7, 8);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 3);\\n swapIfFirstIsLarger(array, 5, 7);\\n swapIfFirstIsLarger(array, 4, 6);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 7, 8);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n } else {\\n // Length: 8\\n swapIfFirstIsLarger(array, 0, 7);\\n swapIfFirstIsLarger(array, 1, 6);\\n swapIfFirstIsLarger(array, 2, 5);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 0, 3);\\n swapIfFirstIsLarger(array, 4, 7);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 0, 1);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 6, 7);\\n swapIfFirstIsLarger(array, 3, 5);\\n swapIfFirstIsLarger(array, 2, 4);\\n swapIfFirstIsLarger(array, 1, 2);\\n swapIfFirstIsLarger(array, 3, 4);\\n swapIfFirstIsLarger(array, 5, 6);\\n swapIfFirstIsLarger(array, 2, 3);\\n swapIfFirstIsLarger(array, 4, 5);\\n swapIfFirstIsLarger(array, 3, 4);\\n }\\n }\\n }\\n }\\n\\n /// @notice Swaps two elements of an array if the first element is greater\\n /// than the second\\n /// @param array Array whose elements are to be swapped\\n /// @param ind1 Index of the first element\\n /// @param ind2 Index of the second element\\n function swapIfFirstIsLarger(\\n int256[] memory array,\\n uint256 ind1,\\n uint256 ind2\\n ) private pure {\\n if (array[ind1] > array[ind2]) {\\n (array[ind1], array[ind2]) = (array[ind2], array[ind1]);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x81e3790f7964b0169e60022f00f988a136e37a043053d8b07c794cc1c9b6c510\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDapiServer.sol\\\";\\nimport \\\"./IBeaconUpdatesWithSignedData.sol\\\";\\n\\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n}\\n\",\"keccak256\":\"0xea2c05eaf2a19c93a9c9b08243fcabd8d7fcf0e4d422f7c687aef693126c1809\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n}\\n\",\"keccak256\":\"0xe2b2530081508baf1323d4c145a688ffd548cf318a8cb67c9ccb4abe1ac81c6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IDapiServer is\\n IAccessControlRegistryAdminnedWithManager,\\n IDataFeedServer\\n{\\n event SetDapiName(\\n bytes32 indexed dataFeedId,\\n bytes32 indexed dapiName,\\n address sender\\n );\\n\\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\\n\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view returns (bytes32);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function dapiNameSetterRole() external view returns (bytes32);\\n\\n function dapiNameHashToDataFeedId(\\n bytes32 dapiNameHash\\n ) external view returns (bytes32 dataFeedId);\\n}\\n\",\"keccak256\":\"0x61cd079ceb84d2b7414b82da71f4f000e52a0a1429065ec666e77ef6e5f21ea1\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IDataFeedServer is IExtendedSelfMulticall {\\n event UpdatedBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedBeaconSetWithBeacons(\\n bytes32 indexed beaconSetId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) external returns (bytes32 beaconSetId);\\n}\\n\",\"keccak256\":\"0x208f751f71b16d454cafd9188095178fdc776ee0376a85362f6022e7a4f010a3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDataFeedServer.sol\\\";\\nimport \\\"./IDapiServer.sol\\\";\\n\\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\\n\",\"keccak256\":\"0xf4082c33979785131358a217a8c5cf498a53c04318868eb1cb68e934c33226e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IOevDataFeedServer is IDataFeedServer {\\n event UpdatedOevProxyBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedOevProxyBeaconSetWithSignedData(\\n bytes32 indexed beaconSetId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event Withdrew(\\n address indexed oevProxy,\\n address oevBeneficiary,\\n uint256 amount\\n );\\n\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable;\\n\\n function withdraw(address oevProxy) external;\\n\\n function oevProxyToBalance(\\n address oevProxy\\n ) external view returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x2d162c576bfe5554767bb48758314c3e6f2c509f73203f0e166d1ac5168a1218\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOevProxy {\\n function oevBeneficiary() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcd9962a465c96e85638eb40775da008f9c86a0ea0c50c7c5fcbb11c55f48fc22\",\"license\":\"MIT\"},\"contracts/utils/ExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\nimport \\\"./SelfMulticall.sol\\\";\\nimport \\\"./interfaces/IExtendedSelfMulticall.sol\\\";\\n\\n/// @title Contract that extends SelfMulticall to fetch some of the global\\n/// variables\\n/// @notice Available global variables are limited to the ones that Airnode\\n/// tends to need\\ncontract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {\\n /// @notice Returns the chain ID\\n /// @return Chain ID\\n function getChainId() external view override returns (uint256) {\\n return block.chainid;\\n }\\n\\n /// @notice Returns the account balance\\n /// @param account Account address\\n /// @return Account balance\\n function getBalance(\\n address account\\n ) external view override returns (uint256) {\\n return account.balance;\\n }\\n\\n /// @notice Returns if the account contains bytecode\\n /// @dev An account not containing any bytecode does not indicate that it\\n /// is an EOA or it will not contain any bytecode in the future.\\n /// Contract construction and `SELFDESTRUCT` updates the bytecode at the\\n /// end of the transaction.\\n /// @return If the account contains bytecode\\n function containsBytecode(\\n address account\\n ) external view override returns (bool) {\\n return account.code.length > 0;\\n }\\n\\n /// @notice Returns the current block number\\n /// @return Current block number\\n function getBlockNumber() external view override returns (uint256) {\\n return block.number;\\n }\\n\\n /// @notice Returns the current block timestamp\\n /// @return Current block timestamp\\n function getBlockTimestamp() external view override returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /// @notice Returns the current block basefee\\n /// @return Current block basefee\\n function getBlockBasefee() external view override returns (uint256) {\\n return block.basefee;\\n }\\n}\\n\",\"keccak256\":\"0xada4020386f51e076953a110accf21efc53b82858bb88fc6725591556d86574b\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISelfMulticall.sol\\\";\\n\\ninterface IExtendedSelfMulticall is ISelfMulticall {\\n function getChainId() external view returns (uint256);\\n\\n function getBalance(address account) external view returns (uint256);\\n\\n function containsBytecode(address account) external view returns (bool);\\n\\n function getBlockNumber() external view returns (uint256);\\n\\n function getBlockTimestamp() external view returns (uint256);\\n\\n function getBlockBasefee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xaefe61a623c920d3e39c4779535e280378b44202d11c29a2c96f46f2fe5f420d\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101206040523480156200001257600080fd5b50604051620039a2380380620039a283398101604081905262000035916200033a565b82828282828282828282826001600160a01b0382166200008f5760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000e25760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000086565b6001600160a01b0382166080526000620000fd8282620004a9565b508060405160200162000111919062000575565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001865760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000086565b6001600160a01b03811660c0526200019e81620001f8565b60e052505060c051620001e49150620001b790620001f8565b60408051808201909152601081526f3220a824903730b6b29039b2ba3a32b960811b602082015262000272565b610100525062000593975050505050505050565b60006200026c6200023d836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002ae83836040516020016200028c919062000575565b60405160208183030381529060405280519060200120620002b560201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200033157818101518382015260200162000317565b50506000910152565b6000806000606084860312156200035057600080fd5b6200035b84620002e1565b60208501519093506001600160401b03808211156200037957600080fd5b818601915086601f8301126200038e57600080fd5b815181811115620003a357620003a3620002fe565b604051601f8201601f19908116603f01168101908382118183101715620003ce57620003ce620002fe565b81604052828152896020848701011115620003e857600080fd5b620003fb83602083016020880162000314565b80965050505050506200041160408501620002e1565b90509250925092565b600181811c908216806200042f57607f821691505b6020821081036200045057634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004a457600081815260208120601f850160051c810160208610156200047f5750805b601f850160051c820191505b81811015620004a0578281556001016200048b565b5050505b505050565b81516001600160401b03811115620004c557620004c5620002fe565b620004dd81620004d684546200041a565b8462000456565b602080601f831160018114620005155760008415620004fc5750858301515b600019600386901b1c1916600185901b178555620004a0565b600085815260208120601f198616915b82811015620005465788860151825594840194600190910190840162000525565b5085821015620005655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516200058981846020870162000314565b9190910192915050565b60805160a05160c05160e051610100516133b8620005ea600039600081816104650152610e31015260006101cc01526000818161035f0152610de2015260005050600081816102530152610e5d01526133b86000f3fe6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220693313c61a998d79d0e9b250367bd14ac439bd3d1d1f36bf50317fc99059456d64736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106101b55760003560e01c806367a7cfb7116100ec578063ac9650d81161008a578063e6ec76ac11610064578063e6ec76ac14610594578063f83ea108146105a7578063f8b2cb4f146105fe578063fce90be81461062657600080fd5b8063ac9650d814610527578063b62408a314610554578063cfaf49711461057457600080fd5b80638e6ddc27116100c65780638e6ddc271461049a5780638fca9ab9146104c757806391eed085146104e7578063a5fc076f1461050757600080fd5b806367a7cfb7146104125780637512449b14610453578063796b89b91461048757600080fd5b8063437b9116116101595780634c8f1d8d116101335780634c8f1d8d146103815780634dcc19fe146103a357806351cff8d9146103b65780635989eaeb146103d857600080fd5b8063437b9116146102f2578063472c22f114610320578063481c6a751461034d57600080fd5b80631ce9ae07116101955780631ce9ae071461024157806332be8f0b1461028d5780633408e470146102cc57806342cbb15c146102df57600080fd5b80629f2f3c146101ba578062aae33f146102015780631a0a0b3e14610221575b600080fd5b3480156101c657600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561020d57600080fd5b506101ee61021c366004612c34565b61066f565b34801561022d57600080fd5b506101ee61023c366004612d31565b61079c565b34801561024d57600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101f8565b34801561029957600080fd5b506102ad6102a8366004612dc7565b610915565b60408051601b9390930b835263ffffffff9091166020830152016101f8565b3480156102d857600080fd5b50466101ee565b3480156102eb57600080fd5b50436101ee565b3480156102fe57600080fd5b5061031261030d366004612e25565b61092a565b6040516101f8929190612ef6565b34801561032c57600080fd5b506101ee61033b366004612dc7565b60046020526000908152604090205481565b34801561035957600080fd5b506102757f000000000000000000000000000000000000000000000000000000000000000081565b34801561038d57600080fd5b50610396610a90565b6040516101f89190612f4f565b3480156103af57600080fd5b50486101ee565b3480156103c257600080fd5b506103d66103d1366004612f62565b610b1e565b005b3480156103e457600080fd5b506104026103f3366004612f62565b6001600160a01b03163b151590565b60405190151581526020016101f8565b34801561041e57600080fd5b506102ad61042d366004612dc7565b600090815260016020526040902054601b81900b91600160e01b90910463ffffffff1690565b34801561045f57600080fd5b506101ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561049357600080fd5b50426101ee565b3480156104a657600080fd5b506101ee6104b5366004612f62565b60036020526000908152604090205481565b3480156104d357600080fd5b506101ee6104e2366004612dc7565b610d45565b3480156104f357600080fd5b506103d6610502366004612f7f565b610d8a565b34801561051357600080fd5b506102ad610522366004612dc7565b610f96565b34801561053357600080fd5b50610547610542366004612e25565b610fa2565b6040516101f89190612fa1565b34801561056057600080fd5b506102ad61056f366004612dc7565b611123565b34801561058057600080fd5b506102ad61058f366004612dc7565b61112f565b6103d66105a2366004612fb4565b61113b565b3480156105b357600080fd5b506102ad6105c2366004613053565b6001600160a01b039190911660009081526002602090815260408083209383529290522054601b81900b91600160e01b90910463ffffffff1690565b34801561060a57600080fd5b506101ee610619366004612f62565b6001600160a01b03163190565b34801561063257600080fd5b506103966040518060400160405280601081526020017f64415049206e616d65207365747465720000000000000000000000000000000081525081565b600080600061067d846116c2565b9150915061068a84611864565b600081815260016020526040902080549194509063ffffffff808416600160e01b9092041603610710578054601b84810b91900b036107105760405162461bcd60e51b815260206004820152601a60248201527f446f6573206e6f742075706461746520426561636f6e2073657400000000000060448201526064015b60405180910390fd5b604080518082018252601b85900b80825263ffffffff858116602080850182815260008b81526001835287902095519051909316600160e01b026001600160e01b0390931692909217909355835191825281019190915285917fb7712be6248d021e8c56ac9613c09491354a4d0f4ad0b7db1a664b35be4b2349910160405180910390a2505050919050565b6000876001600160a01b031661081d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505060405161081792506107fc91508c908c908c908c9060200161307f565b60405160208183030381529060405280519060200120611894565b906118cf565b6001600160a01b0316146108735760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b50604080516bffffffffffffffffffffffff1960608a901b1660208083019190915260348083018a9052835180840390910181526054909201909252805191012060006108c2828888886118f5565b60408051601b83900b815263ffffffff8a16602082015291925083917f1ffdb573afe7273932e253bc4b8a17b9da4d37d7219ba05e464358975b36efb7910160405180910390a250979650505050505050565b60008061092183611a4a565b91509150915091565b606080828067ffffffffffffffff81111561094757610947612bed565b604051908082528060200260200182016040528015610970578160200160208202803683370190505b5092508067ffffffffffffffff81111561098c5761098c612bed565b6040519080825280602002602001820160405280156109bf57816020015b60608152602001906001900390816109aa5790505b50915060005b81811015610a8757308686838181106109e0576109e06130a0565b90506020028101906109f291906130b6565b604051610a009291906130fd565b600060405180830381855af49150503d8060008114610a3b576040519150601f19603f3d011682016040523d82523d6000602084013e610a40565b606091505b50858381518110610a5357610a536130a0565b60200260200101858481518110610a6c57610a6c6130a0565b602090810291909101019190915290151590526001016109c5565b50509250929050565b60008054610a9d9061310d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ac99061310d565b8015610b165780601f10610aeb57610100808354040283529160200191610b16565b820191906000526020600020905b815481529060010190602001808311610af957829003601f168201915b505050505081565b6000816001600160a01b0316630e15999d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190613141565b90506001600160a01b038116610bda5760405162461bcd60e51b815260206004820152601860248201527f42656e65666963696172792061646472657373207a65726f00000000000000006044820152606401610707565b6001600160a01b03821660009081526003602052604081205490819003610c435760405162461bcd60e51b815260206004820152601660248201527f4f45562070726f78792062616c616e6365207a65726f000000000000000000006044820152606401610707565b6001600160a01b0383811660008181526003602090815260408083209290925581519386168452830184905290917f0472be967f9a37138dfea1875af44784cafb79f92044ab33d7d6958eddd9ca6c910160405180910390a26000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ce9576040519150601f19603f3d011682016040523d82523d6000602084013e610cee565b606091505b5050905080610d3f5760405162461bcd60e51b815260206004820152601360248201527f5769746864726177616c207265766572746564000000000000000000000000006044820152606401610707565b50505050565b60006004600083604051602001610d5e91815260200190565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b81610dd75760405162461bcd60e51b815260206004820152600e60248201527f64415049206e616d65207a65726f0000000000000000000000000000000000006044820152606401610707565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610ed057506040517f91d148540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa158015610eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed0919061315e565b610f1c5760405162461bcd60e51b815260206004820152601b60248201527f53656e6465722063616e6e6f74207365742064415049206e616d6500000000006044820152606401610707565b806004600084604051602001610f3491815260200190565b60408051601f1981840301815291815281516020928301208352828201939093529082016000209290925551338152839183917ff3a9aac9b6ac0f842cb5d9b3491cd5fc1b6a6778d97fd9529f587339865294f5910160405180910390a35050565b60008061092183611b7d565b6060818067ffffffffffffffff811115610fbe57610fbe612bed565b604051908082528060200260200182016040528015610ff157816020015b6060815260200190600190039081610fdc5790505b50915060005b8181101561111b57600030868684818110611014576110146130a0565b905060200281019061102691906130b6565b6040516110349291906130fd565b600060405180830381855af49150503d806000811461106f576040519150601f19603f3d011682016040523d82523d6000602084013e611074565b606091505b50858481518110611087576110876130a0565b60209081029190910101529050806111125760008483815181106110ad576110ad6130a0565b602002602001015190506000815111156110ca5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e6700000000006044820152606401610707565b50600101610ff7565b505092915050565b60008061092183611bf5565b60008061092183611ccd565b8442610e1001811061118f5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b6001600160a01b03891660009081526002602090815260408083208b8452909152902054600160e01b900463ffffffff16861161120e5760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b600046308b8b8b8b8b8b33346040516020016112339a99989796959493929190613180565b604051602081830303815290604052805190602001209050600061128c87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b9050878460018111156114615760008167ffffffffffffffff8111156112b4576112b4612bed565b6040519080825280602002602001820160405280156112dd578160200160208202803683370190505b5090506000805b8381101561135057600061131b888c8c85818110611304576113046130a0565b905060200281019061131691906130b6565b611ea2565b85848151811061132d5761132d6130a0565b602090810291909101015290508015611347576001909201915b506001016112e4565b5061135c6002846131ff565b81116113aa5760405162461bcd60e51b815260206004820152601560248201527f4e6f7420656e6f756768207369676e61747572657300000000000000000000006044820152606401610707565b6113b382611864565b8e146114015760405162461bcd60e51b815260206004820152601660248201527f426561636f6e20736574204944206d69736d61746368000000000000000000006044820152606401610707565b8c8f6001600160a01b03168f7fdd29860e0772a39dea2ff0520d79f8efdffe48c903d6bbbc0c2cc65dc6568a7f8888604051611452929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a450506115cb565b8060010361158357600080611483868a8a6000818110611304576113046130a0565b91509150816114d45760405162461bcd60e51b815260206004820152601160248201527f4d697373696e67207369676e61747572650000000000000000000000000000006044820152606401610707565b808e146115235760405162461bcd60e51b815260206004820152601260248201527f426561636f6e204944206d69736d6174636800000000000000000000000000006044820152606401610707565b50508a8d6001600160a01b03168d7fc856aaa4e639403f366ad68f07eb69bad4c044a35b0369c4ef1ea3a427a6a0ee8686604051611576929190601b9290920b825263ffffffff16602082015260400190565b60405180910390a46115cb565b60405162461bcd60e51b815260206004820152601b60248201527f446964206e6f74207370656369667920616e7920426561636f6e7300000000006044820152606401610707565b604051806040016040528084601b0b81526020018363ffffffff16815250600260008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008e815260200190815260200160002060008201518160000160006101000a8154816001600160e01b030219169083601b0b6001600160e01b03160217905550602082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555090505034600360008f6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546116ae9190613213565b909155505050505050505050505050505050565b80516000908190600181116117195760405162461bcd60e51b815260206004820152601f60248201527f537065636966696564206c657373207468616e2074776f20426561636f6e73006044820152606401610707565b60008167ffffffffffffffff81111561173457611734612bed565b60405190808252806020026020018201604052801561175d578160200160208202803683370190505b50905060008267ffffffffffffffff81111561177b5761177b612bed565b6040519080825280602002602001820160405280156117a4578160200160208202803683370190505b50905060005b83811015611845576000600160008984815181106117ca576117ca6130a0565b602090810291909101810151825281019190915260400160002080548551919250601b0b90859084908110611801576118016130a0565b602090810291909101015280548351600160e01b90910463ffffffff1690849084908110611831576118316130a0565b6020908102919091010152506001016117aa565b5061184f82611fa4565b945061185a81611fa4565b9350505050915091565b6000816040516020016118779190613234565b604051602081830303815290604052805190602001209050919050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01611877565b60008060006118de85856120fd565b915091506118eb81612142565b5090505b92915050565b60008342610e1001811061194b5760405162461bcd60e51b815260206004820152601360248201527f54696d657374616d70206e6f742076616c6964000000000000000000000000006044820152606401610707565b61198a84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d9f92505050565b600087815260016020526040902054909250600160e01b900463ffffffff1685116119f75760405162461bcd60e51b815260206004820152601960248201527f446f6573206e6f74207570646174652074696d657374616d70000000000000006044820152606401610707565b50604080518082018252601b83900b815263ffffffff95861660208083019182526000988952600190529190962095519051909416600160e01b026001600160e01b039094169390931790935550919050565b600081815260046020526040812054819080611aa85760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b336000908152600260209081526040808320848452825280832060019092529091208054825463ffffffff600160e01b92839004811692909104161115611b06578154601b81900b9550600160e01b900463ffffffff169350611b1f565b8054601b81900b9550600160e01b900463ffffffff1693505b60008463ffffffff1611611b755760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b505050915091565b60008181526001602052604090208054601b81900b91600160e01b90910463ffffffff169081611bef5760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b50915091565b600081815260046020526040812054819080611c535760405162461bcd60e51b815260206004820152601160248201527f64415049206e616d65206e6f74207365740000000000000000000000000000006044820152606401610707565b60008181526001602052604090208054601b81900b9450600160e01b900463ffffffff16925082611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b5050915091565b336000908152600260209081526040808320848452825280832060019092528220805482548493929163ffffffff600160e01b918290048116919092049091161115611d30578154601b81900b9450600160e01b900463ffffffff169250611d49565b8054601b81900b9450600160e01b900463ffffffff1692505b60008363ffffffff1611611cc65760405162461bcd60e51b815260206004820152601960248201527f446174612066656564206e6f7420696e697469616c697a6564000000000000006044820152606401610707565b60008151602014611df25760405162461bcd60e51b815260206004820152601760248201527f44617461206c656e677468206e6f7420636f72726563740000000000000000006044820152606401610707565b600082806020019051810190611e089190613278565b90507fffffffff800000000000000000000000000000000000000000000000000000008112801590611e5657507b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff8113155b6118ef5760405162461bcd60e51b815260206004820152601760248201527f56616c7565207479706563617374696e67206572726f720000000000000000006044820152606401610707565b600080808080611eb486880188613291565b925092509250611f0683836040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b93508051600014611f9957826001600160a01b0316611f3e826108178b866040516020016107fc929190918252602082015260400190565b6001600160a01b031614611f945760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d6174636800000000000000000000000000006044820152606401610707565b600194505b505050935093915050565b80516000906009811161207d57611fba836122aa565b611fc5600282613342565b600103611ff85782611fd86002836131ff565b81518110611fe857611fe86130a0565b6020026020010151915050919050565b8060000361200857612008613356565b612076836001600284040381518110612023576120236130a0565b6020026020010151846002848161203c5761203c6131e9565b048151811061204d5761204d6130a0565b6020026020010151600182811d82821d01838316919091160160ff81901c838318160192915050565b9392505050565b612088600282613342565b6001036120a45782611fd88161209f6002856131ff565b6127bc565b6000806120b785600160028604036127e9565b80925081935050506120ee8583815181106120d4576120d46130a0565b602002602001015186838151811061204d5761204d6130a0565b95945050505050565b50919050565b60008082516041036121335760208301516040840151606085015160001a6121278782858561281e565b9450945050505061213b565b506000905060025b9250929050565b60008160048111156121565761215661336c565b0361215e5750565b60018160048111156121725761217261336c565b036121bf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610707565b60028160048111156121d3576121d361336c565b036122205760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610707565b60038160048111156122345761223461336c565b036122a75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610707565b50565b805160098111156122fd5760405162461bcd60e51b815260206004820152601660248201527f417272617920746f6f206c6f6e6720746f20736f7274000000000000000000006044820152606401610707565b600681101561240857600481101561235757806003036123425761232482600060016128e2565b61233182600160026128e2565b61233e82600060016128e2565b5050565b8060020361233e5761233e82600060016128e2565b806005036123d45761236c82600160026128e2565b61237982600360046128e2565b61238682600160036128e2565b61239382600060026128e2565b6123a082600260046128e2565b6123ad82600060036128e2565b6123ba82600060016128e2565b6123c782600260036128e2565b61233e82600160026128e2565b6123e182600060016128e2565b6123ee82600260036128e2565b6123fb82600160036128e2565b6123c782600060026128e2565b600881101561258557806007036124e95761242682600160026128e2565b61243382600360046128e2565b61244082600560066128e2565b61244d82600060026128e2565b61245a82600460066128e2565b61246782600360056128e2565b61247482600260066128e2565b61248182600160056128e2565b61248e82600060046128e2565b61249b82600260056128e2565b6124a882600060036128e2565b6124b582600260046128e2565b6124c282600160036128e2565b6124cf82600060016128e2565b6124dc82600260036128e2565b61233e82600460056128e2565b6124f682600060016128e2565b61250382600260036128e2565b61251082600460056128e2565b61251d82600160036128e2565b61252a82600360056128e2565b61253782600160036128e2565b61254482600260046128e2565b61255182600060026128e2565b61255e82600260046128e2565b61256b82600360046128e2565b61257882600160026128e2565b61233e82600260036128e2565b806009036126b85761259a82600160086128e2565b6125a782600260076128e2565b6125b482600360066128e2565b6125c182600460056128e2565b6125ce82600160046128e2565b6125db82600560086128e2565b6125e882600060026128e2565b6125f582600660076128e2565b61260282600260066128e2565b61260f82600760086128e2565b61261c82600060036128e2565b61262982600460056128e2565b61263682600060016128e2565b61264382600360056128e2565b61265082600660076128e2565b61265d82600260046128e2565b61266a82600160036128e2565b61267782600560076128e2565b61268482600460066128e2565b61269182600160026128e2565b61269e82600360046128e2565b6126ab82600560066128e2565b6124cf82600760086128e2565b6126c582600060076128e2565b6126d282600160066128e2565b6126df82600260056128e2565b6126ec82600360046128e2565b6126f982600060036128e2565b61270682600460076128e2565b61271382600160026128e2565b61272082600560066128e2565b61272d82600060016128e2565b61273a82600260036128e2565b61274782600460056128e2565b61275482600660076128e2565b61276182600360056128e2565b61276e82600260046128e2565b61277b82600160026128e2565b61278882600360046128e2565b61279582600560066128e2565b6127a282600260036128e2565b6127af82600460056128e2565b61233e82600360046128e2565b8151600090806127ce576127ce613356565b6127e084600060018403866000612990565b50949350505050565b815160009081906001811161280057612800613356565b61281285600060018403876001612990565b90969095509350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561285557506000905060036128d9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156128a9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166128d2576000600192509250506128d9565b9150600090505b94509492505050565b8281815181106128f4576128f46130a0565b602002602001015183838151811061290e5761290e6130a0565b6020026020010151131561298b5782818151811061292e5761292e6130a0565b6020026020010151838381518110612948576129486130a0565b6020026020010151848481518110612962576129626130a0565b6020026020010185848151811061297b5761297b6130a0565b6020908102919091010191909152525b505050565b6000808486036129a557508290506000612a5c565b60006129b2888888612a66565b9050808510156129d5576129cd888860018403886000612990565b5092506129f2565b808511156129ee576129cd888260010188886000612990565b8092505b8315612a5a57875160018401925060028401905b80821015612a5757898481518110612a2057612a206130a0565b60200260200101518a8381518110612a3a57612a3a6130a0565b60200260200101511215612a4c578193505b600190910190612a06565b50505b505b9550959350505050565b6000818303612a76575081612076565b6000848481518110612a8a57612a8a6130a0565b6020026020010151905060008490508360010192505b855160019091019081108015612ace575081868281518110612ac457612ac46130a0565b6020026020010151125b612aa0575b82806001900393505081868481518110612aef57612aef6130a0565b602002602001015113612ad357828110612b7a57858381518110612b1557612b156130a0565b6020026020010151868681518110612b2f57612b2f6130a0565b6020026020010151878781518110612b4957612b496130a0565b60200260200101888681518110612b6257612b626130a0565b60200260200101828152508281525050505050612076565b858381518110612b8c57612b8c6130a0565b6020026020010151868281518110612ba657612ba66130a0565b6020026020010151878381518110612bc057612bc06130a0565b60200260200101888681518110612bd957612bd96130a0565b602090810291909101019190915252612aa0565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2c57612c2c612bed565b604052919050565b60006020808385031215612c4757600080fd5b823567ffffffffffffffff80821115612c5f57600080fd5b818501915085601f830112612c7357600080fd5b813581811115612c8557612c85612bed565b8060051b9150612c96848301612c03565b8181529183018401918481019088841115612cb057600080fd5b938501935b83851015612cce57843582529385019390850190612cb5565b98975050505050505050565b6001600160a01b03811681146122a757600080fd5b60008083601f840112612d0157600080fd5b50813567ffffffffffffffff811115612d1957600080fd5b60208301915083602082850101111561213b57600080fd5b600080600080600080600060a0888a031215612d4c57600080fd5b8735612d5781612cda565b96506020880135955060408801359450606088013567ffffffffffffffff80821115612d8257600080fd5b612d8e8b838c01612cef565b909650945060808a0135915080821115612da757600080fd5b50612db48a828b01612cef565b989b979a50959850939692959293505050565b600060208284031215612dd957600080fd5b5035919050565b60008083601f840112612df257600080fd5b50813567ffffffffffffffff811115612e0a57600080fd5b6020830191508360208260051b850101111561213b57600080fd5b60008060208385031215612e3857600080fd5b823567ffffffffffffffff811115612e4f57600080fd5b61281285828601612de0565b6000815180845260005b81811015612e8157602081850181015186830182015201612e65565b506000602082860101526020601f19601f83011685010191505092915050565b600081518084526020808501808196508360051b8101915082860160005b85811015612ee9578284038952612ed7848351612e5b565b98850198935090840190600101612ebf565b5091979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015612f31578151151584529284019290840190600101612f13565b50505083810382850152612f458186612ea1565b9695505050505050565b6020815260006120766020830184612e5b565b600060208284031215612f7457600080fd5b813561207681612cda565b60008060408385031215612f9257600080fd5b50508035926020909101359150565b6020815260006120766020830184612ea1565b60008060008060008060008060c0898b031215612fd057600080fd5b8835612fdb81612cda565b9750602089013596506040890135955060608901359450608089013567ffffffffffffffff8082111561300d57600080fd5b6130198c838d01612cef565b909650945060a08b013591508082111561303257600080fd5b5061303f8b828c01612de0565b999c989b5096995094979396929594505050565b6000806040838503121561306657600080fd5b823561307181612cda565b946020939093013593505050565b84815283602082015281836040830137600091016040019081529392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126130cd57600080fd5b83018035915067ffffffffffffffff8211156130e857600080fd5b60200191503681900382131561213b57600080fd5b8183823760009101908152919050565b600181811c9082168061312157607f821691505b6020821081036120f757634e487b7160e01b600052602260045260246000fd5b60006020828403121561315357600080fd5b815161207681612cda565b60006020828403121561317057600080fd5b8151801515811461207657600080fd5b8a815260006bffffffffffffffffffffffff19808c60601b166020840152808b60601b166034840152896048840152886068840152876088840152858760a885013760609490941b909316930160a881019390935260bc8301525060dc01979650505050505050565b634e487b7160e01b600052601260045260246000fd5b60008261320e5761320e6131e9565b500490565b808201808211156118ef57634e487b7160e01b600052601160045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561326c57835183529284019291840191600101613250565b50909695505050505050565b60006020828403121561328a57600080fd5b5051919050565b6000806000606084860312156132a657600080fd5b83356132b181612cda565b92506020848101359250604085013567ffffffffffffffff808211156132d657600080fd5b818701915087601f8301126132ea57600080fd5b8135818111156132fc576132fc612bed565b61330e601f8201601f19168501612c03565b9150808252888482850101111561332457600080fd5b80848401858401376000848284010152508093505050509250925092565b600082613351576133516131e9565b500690565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220693313c61a998d79d0e9b250367bd14ac439bd3d1d1f36bf50317fc99059456d64736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "_accessControlRegistry": "AccessControlRegistry contract address", + "_adminRoleDescription": "Admin role description", + "_manager": "Manager address" + } + }, + "containsBytecode(address)": { + "details": "An account not containing any bytecode does not indicate that it is an EOA or it will not contain any bytecode in the future. Contract construction and `SELFDESTRUCT` updates the bytecode at the end of the transaction.", + "returns": { + "_0": "If the account contains bytecode" + } + }, + "dapiNameToDataFeedId(bytes32)": { + "params": { + "dapiName": "dAPI name" + }, + "returns": { + "_0": "Data feed ID" + } + }, + "getBalance(address)": { + "params": { + "account": "Account address" + }, + "returns": { + "_0": "Account balance" + } + }, + "getBlockBasefee()": { + "returns": { + "_0": "Current block basefee" + } + }, + "getBlockNumber()": { + "returns": { + "_0": "Current block number" + } + }, + "getBlockTimestamp()": { + "returns": { + "_0": "Current block timestamp" + } + }, + "getChainId()": { + "returns": { + "_0": "Chain ID" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "readDataFeedWithDapiNameHash(bytes32)": { + "params": { + "dapiNameHash": "dAPI name hash" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithDapiNameHashAsOevProxy(bytes32)": { + "params": { + "dapiNameHash": "dAPI name hash" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithId(bytes32)": { + "params": { + "dataFeedId": "Data feed ID" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "readDataFeedWithIdAsOevProxy(bytes32)": { + "params": { + "dataFeedId": "Data feed ID" + }, + "returns": { + "timestamp": "Data feed timestamp", + "value": "Data feed value" + } + }, + "setDapiName(bytes32,bytes32)": { + "details": "While a data feed ID refers to a specific Beacon or Beacon set, dAPI names provide a more abstract interface for convenience. This means a dAPI name that was pointing to a Beacon can be pointed to a Beacon set, then another Beacon set, etc.", + "params": { + "dapiName": "Human-readable dAPI name", + "dataFeedId": "Data feed ID the dAPI name will point to" + } + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "details": "As an oddity, this function still works if some of the IDs in `beaconIds` belong to Beacon sets rather than Beacons. This can be used to implement hierarchical Beacon sets.", + "params": { + "beaconIds": "Beacon IDs" + }, + "returns": { + "beaconSetId": "Beacon set ID" + } + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "details": "The signed data here is intentionally very general for practical reasons. It is less demanding on the signer to have data signed once and use that everywhere.", + "params": { + "airnode": "Airnode address", + "data": "Update data (an `int256` encoded in contract ABI)", + "signature": "Template ID, timestamp and the update data signed by the Airnode", + "templateId": "Template ID", + "timestamp": "Signature timestamp" + }, + "returns": { + "beaconId": "Updated Beacon ID" + } + }, + "updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])": { + "details": "For when the data feed being updated is a Beacon set, an absolute majority of the Airnodes that power the respective Beacons must sign the aggregated value and timestamp. While doing so, the Airnodes should refer to data signed to update an absolute majority of the respective Beacons. The Airnodes should require the data to be fresh enough (e.g., at most 2 minutes-old), and tightly distributed around the resulting aggregation (e.g., within 1% deviation), and reject to provide an OEV proxy data feed update signature if these are not satisfied.", + "params": { + "data": "Update data (an `int256` encoded in contract ABI)", + "dataFeedId": "Data feed ID", + "oevProxy": "OEV proxy that reads the data feed", + "packedOevUpdateSignatures": "Packed OEV update signatures, which include the Airnode address, template ID and these signed with the OEV update hash", + "timestamp": "Signature timestamp", + "updateId": "Update ID" + } + }, + "withdraw(address)": { + "details": "This does not require the caller to be the beneficiary because we expect that in most cases, the OEV beneficiary will be a contract that will not be able to make arbitrary calls. Our choice can be worked around by implementing a beneficiary proxy.", + "params": { + "oevProxy": "OEV proxy" + } + } + }, + "title": "First version of the contract that API3 uses to serve data feeds", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "DAPI_NAME_SETTER_ROLE_DESCRIPTION()": { + "notice": "dAPI name setter role description" + }, + "accessControlRegistry()": { + "notice": "AccessControlRegistry contract address" + }, + "adminRole()": { + "notice": "Admin role" + }, + "adminRoleDescription()": { + "notice": "Admin role description" + }, + "containsBytecode(address)": { + "notice": "Returns if the account contains bytecode" + }, + "dapiNameHashToDataFeedId(bytes32)": { + "notice": "dAPI name hash mapped to the data feed ID" + }, + "dapiNameSetterRole()": { + "notice": "dAPI name setter role" + }, + "dapiNameToDataFeedId(bytes32)": { + "notice": "Returns the data feed ID the dAPI name is set to" + }, + "getBalance(address)": { + "notice": "Returns the account balance" + }, + "getBlockBasefee()": { + "notice": "Returns the current block basefee" + }, + "getBlockNumber()": { + "notice": "Returns the current block number" + }, + "getBlockTimestamp()": { + "notice": "Returns the current block timestamp" + }, + "getChainId()": { + "notice": "Returns the chain ID" + }, + "manager()": { + "notice": "Address of the manager that manages the related AccessControlRegistry roles" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "oevProxyToBalance(address)": { + "notice": "Accumulated OEV auction proceeds for the specific proxy" + }, + "readDataFeedWithDapiNameHash(bytes32)": { + "notice": "Reads the data feed with dAPI name hash" + }, + "readDataFeedWithDapiNameHashAsOevProxy(bytes32)": { + "notice": "Reads the data feed as the OEV proxy with dAPI name hash" + }, + "readDataFeedWithId(bytes32)": { + "notice": "Reads the data feed with ID" + }, + "readDataFeedWithIdAsOevProxy(bytes32)": { + "notice": "Reads the data feed as the OEV proxy with ID" + }, + "setDapiName(bytes32,bytes32)": { + "notice": "Sets the data feed ID the dAPI name points to" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + }, + "updateBeaconSetWithBeacons(bytes32[])": { + "notice": "Updates the Beacon set using the current values of its Beacons" + }, + "updateBeaconWithSignedData(address,bytes32,uint256,bytes,bytes)": { + "notice": "Updates a Beacon using data signed by the Airnode" + }, + "updateOevProxyDataFeedWithSignedData(address,bytes32,bytes32,uint256,bytes,bytes[])": { + "notice": "Updates a data feed that the OEV proxy reads using the aggregation signed by the absolute majority of the respective Airnodes for the specific bid" + }, + "withdraw(address)": { + "notice": "Withdraws the balance of the OEV proxy to the respective beneficiary account" + } + }, + "notice": "Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets, dAPIs, with optional OEV support for all of these. The base Beacons are only updateable using signed data, and the Beacon sets are updateable based on the Beacons, optionally using PSP. OEV proxy Beacons and Beacon sets are updateable using OEV-signed data. Api3ServerV1 does not support Beacons to be updated using RRP or PSP.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5177, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "adminRoleDescription", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 6455, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "_dataFeeds", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_struct(DataFeed)6449_storage)" + }, + { + "astId": 6944, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "_oevProxyToIdToDataFeed", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)6449_storage))" + }, + { + "astId": 6950, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "oevProxyToBalance", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 6277, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "dapiNameHashToDataFeedId", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_bytes32,t_bytes32)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_int224": { + "encoding": "inplace", + "label": "int224", + "numberOfBytes": "28" + }, + "t_mapping(t_address,t_mapping(t_bytes32,t_struct(DataFeed)6449_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(bytes32 => struct DataFeedServer.DataFeed))", + "numberOfBytes": "32", + "value": "t_mapping(t_bytes32,t_struct(DataFeed)6449_storage)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bytes32)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_bytes32,t_struct(DataFeed)6449_storage)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => struct DataFeedServer.DataFeed)", + "numberOfBytes": "32", + "value": "t_struct(DataFeed)6449_storage" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(DataFeed)6449_storage": { + "encoding": "inplace", + "label": "struct DataFeedServer.DataFeed", + "members": [ + { + "astId": 6446, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "value", + "offset": 0, + "slot": "0", + "type": "t_int224" + }, + { + "astId": 6448, + "contract": "contracts/api3-server-v1/Api3ServerV1.sol:Api3ServerV1", + "label": "timestamp", + "offset": 28, + "slot": "0", + "type": "t_uint32" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} diff --git a/deployments/blast/OrderPayable.json b/deployments/blast/OrderPayable.json new file mode 100644 index 00000000..dbdeee67 --- /dev/null +++ b/deployments/blast/OrderPayable.json @@ -0,0 +1,441 @@ +{ + "address": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlRegistry", + "type": "address" + }, + { + "internalType": "string", + "name": "_adminRoleDescription", + "type": "string" + }, + { + "internalType": "address", + "name": "_manager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expirationTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "orderSigner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "PaidForOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrew", + "type": "event" + }, + { + "inputs": [], + "name": "ORDER_SIGNER_ROLE_DESCRIPTION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WITHDRAWER_ROLE_DESCRIPTION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "adminRoleDescription", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "orderIdToPaymentStatus", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderSignerRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedData", + "type": "bytes" + } + ], + "name": "payForOrder", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "tryMulticall", + "outputs": [ + { + "internalType": "bool[]", + "name": "successes", + "type": "bool[]" + }, + { + "internalType": "bytes[]", + "name": "returndata", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawerRole", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x278c90b88430f9978ca6659e0331c1a49b85d0fcb26deaac52a05afbbfed9f98", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "1235415", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc01230e41eade78ab9973213d25ac182c41e0fa1977551f9c5ce83c5c32e7415", + "transactionHash": "0x278c90b88430f9978ca6659e0331c1a49b85d0fcb26deaac52a05afbbfed9f98", + "logs": [], + "blockNumber": 114826, + "cumulativeGasUsed": "1282372", + "status": 1, + "byzantium": true + }, + "args": [ + "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "OrderPayable admin (API3 Market)", + "0x81bc85f329cDB28936FbB239f734AE495121F9A6" + ], + "numDeployments": 1, + "solcInputHash": "16343b63dc5abcc6d4d0ea75eb689f42", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlRegistry\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_adminRoleDescription\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expirationTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"orderSigner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"PaidForOrder\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdrew\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ORDER_SIGNER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WITHDRAWER_ROLE_DESCRIPTION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminRoleDescription\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orderIdToPaymentStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"orderSignerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"encodedData\",\"type\":\"bytes\"}],\"name\":\"payForOrder\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"tryMulticall\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"successes\",\"type\":\"bool[]\"},{\"internalType\":\"bytes[]\",\"name\":\"returndata\",\"type\":\"bytes[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawerRole\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_accessControlRegistry\":\"AccessControlRegistry contract address\",\"_adminRoleDescription\":\"Admin role description\",\"_manager\":\"Manager address\"}},\"multicall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\"}},\"payForOrder(bytes)\":{\"details\":\"The sender must set `msg.value` to cover the exact amount specified by the order. Input arguments are provided in encoded form to improve the UX for using ABI-based, automatically generated contract GUIs such as ones from Safe and Etherscan. Given that OrderPayable is verified, the user is only required to provide the OrderPayable address, select `payForOrder()`, copy-paste `encodedData` (instead of 4 separate fields) and enter `msg.value`.\",\"params\":{\"encodedData\":\"The order ID, expiration timestamp, order signer address and signature in ABI-encoded form\"}},\"tryMulticall(bytes[])\":{\"params\":{\"data\":\"Array of calldata of batched calls\"},\"returns\":{\"returndata\":\"Array of returndata of batched calls\",\"successes\":\"Array of success conditions of batched calls\"}},\"withdraw(address)\":{\"params\":{\"recipient\":\"Recipient address\"},\"returns\":{\"amount\":\"Withdrawal amount\"}}},\"title\":\"Contract used to pay for orders denoted in the native currency\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"ORDER_SIGNER_ROLE_DESCRIPTION()\":{\"notice\":\"Order signer role description\"},\"WITHDRAWER_ROLE_DESCRIPTION()\":{\"notice\":\"Withdrawer role description\"},\"accessControlRegistry()\":{\"notice\":\"AccessControlRegistry contract address\"},\"adminRole()\":{\"notice\":\"Admin role\"},\"adminRoleDescription()\":{\"notice\":\"Admin role description\"},\"manager()\":{\"notice\":\"Address of the manager that manages the related AccessControlRegistry roles\"},\"multicall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts\"},\"orderIdToPaymentStatus(bytes32)\":{\"notice\":\"Returns if the order with ID is paid for\"},\"orderSignerRole()\":{\"notice\":\"Order signer role\"},\"payForOrder(bytes)\":{\"notice\":\"Called with value to pay for an order\"},\"tryMulticall(bytes[])\":{\"notice\":\"Batches calls to the inheriting contract but does not revert if any of the batched calls reverts\"},\"withdraw(address)\":{\"notice\":\"Called by a withdrawer to withdraw the entire balance of OrderPayable to `recipient`\"},\"withdrawerRole()\":{\"notice\":\"Withdrawer role\"}},\"notice\":\"OrderPayable is managed by an account that designates order signers and withdrawers. Only orders for which a signature is issued for by an order signer can be paid for. Order signers have to be EOAs to be able to issue ERC191 signatures. The manager is responsible with reverting unwanted signatures (for example, if a compromised order signer issues an underpriced order and the order is paid for, the manager should revoke the role, refund the payment and consider the order void). Withdrawers can be EOAs or contracts. For example, one can implement a withdrawer contract that withdraws funds automatically to a Funder contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/OrderPayable.sol\":\"OrderPayable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n }\\n}\\n\",\"keccak256\":\"0xda898fa084aa1ddfdb346e6a40459e00a59d87071cce7c315a46d648dd71d0ba\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/access-control-registry/AccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/SelfMulticall.sol\\\";\\nimport \\\"./RoleDeriver.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistry.sol\\\";\\n\\n/// @title Contract to be inherited by contracts whose adminship functionality\\n/// will be implemented using AccessControlRegistry\\ncontract AccessControlRegistryAdminned is\\n SelfMulticall,\\n RoleDeriver,\\n IAccessControlRegistryAdminned\\n{\\n /// @notice AccessControlRegistry contract address\\n address public immutable override accessControlRegistry;\\n\\n /// @notice Admin role description\\n string public override adminRoleDescription;\\n\\n bytes32 internal immutable adminRoleDescriptionHash;\\n\\n /// @dev Contracts deployed with the same admin role descriptions will have\\n /// the same roles, meaning that granting an account a role will authorize\\n /// it in multiple contracts. Unless you want your deployed contract to\\n /// share the role configuration of another contract, use a unique admin\\n /// role description.\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription\\n ) {\\n require(_accessControlRegistry != address(0), \\\"ACR address zero\\\");\\n require(\\n bytes(_adminRoleDescription).length > 0,\\n \\\"Admin role description empty\\\"\\n );\\n accessControlRegistry = _accessControlRegistry;\\n adminRoleDescription = _adminRoleDescription;\\n adminRoleDescriptionHash = keccak256(\\n abi.encodePacked(_adminRoleDescription)\\n );\\n }\\n\\n /// @notice Derives the admin role for the specific manager address\\n /// @param manager Manager address\\n /// @return adminRole Admin role\\n function _deriveAdminRole(\\n address manager\\n ) internal view returns (bytes32 adminRole) {\\n adminRole = _deriveRole(\\n _deriveRootRole(manager),\\n adminRoleDescriptionHash\\n );\\n }\\n}\\n\",\"keccak256\":\"0x813755d99a9d8dd6298720da68fb5a6dd69329ea2dec91da1d09f715d4543c15\",\"license\":\"MIT\"},\"contracts/access-control-registry/AccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./AccessControlRegistryAdminned.sol\\\";\\nimport \\\"./interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\n\\n/// @title Contract to be inherited by contracts with manager whose adminship\\n/// functionality will be implemented using AccessControlRegistry\\n/// @notice The manager address here is expected to belong to an\\n/// AccessControlRegistry user that is a multisig/DAO\\ncontract AccessControlRegistryAdminnedWithManager is\\n AccessControlRegistryAdminned,\\n IAccessControlRegistryAdminnedWithManager\\n{\\n /// @notice Address of the manager that manages the related\\n /// AccessControlRegistry roles\\n /// @dev The mutability of the manager role can be implemented by\\n /// designating an OwnableCallForwarder contract as the manager. The\\n /// ownership of this contract can then be transferred, effectively\\n /// transferring managership.\\n address public immutable override manager;\\n\\n /// @notice Admin role\\n /// @dev Since `manager` is immutable, so is `adminRole`\\n bytes32 public immutable override adminRole;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminned(\\n _accessControlRegistry,\\n _adminRoleDescription\\n )\\n {\\n require(_manager != address(0), \\\"Manager address zero\\\");\\n manager = _manager;\\n adminRole = _deriveAdminRole(_manager);\\n }\\n}\\n\",\"keccak256\":\"0xbe5df884327dd7d4e236c105b6ef52cc6db20b452f4cdbe6c50fa506ed66cace\",\"license\":\"MIT\"},\"contracts/access-control-registry/RoleDeriver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @title Contract to be inherited by contracts that will derive\\n/// AccessControlRegistry roles\\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\\n/// derive roles, it should inherit this contract instead of re-implementing\\n/// the logic\\ncontract RoleDeriver {\\n /// @notice Derives the root role of the manager\\n /// @param manager Manager address\\n /// @return rootRole Root role\\n function _deriveRootRole(\\n address manager\\n ) internal pure returns (bytes32 rootRole) {\\n rootRole = keccak256(abi.encodePacked(manager));\\n }\\n\\n /// @notice Derives the role using its admin role and description\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param description Human-readable description of the role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n string memory description\\n ) internal pure returns (bytes32 role) {\\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\\n }\\n\\n /// @notice Derives the role using its admin role and description hash\\n /// @dev This implies that roles adminned by the same role cannot have the\\n /// same description\\n /// @param adminRole Admin role\\n /// @param descriptionHash Hash of the human-readable description of the\\n /// role\\n /// @return role Role\\n function _deriveRole(\\n bytes32 adminRole,\\n bytes32 descriptionHash\\n ) internal pure returns (bytes32 role) {\\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\\n }\\n}\\n\",\"keccak256\":\"0x488adb3cb7031415d4a195230753a0ac8f9f610e6db7a571529a350e29c97ed6\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\\n event InitializedManager(\\n bytes32 indexed rootRole,\\n address indexed manager,\\n address sender\\n );\\n\\n event InitializedRole(\\n bytes32 indexed role,\\n bytes32 indexed adminRole,\\n string description,\\n address sender\\n );\\n\\n function initializeManager(address manager) external;\\n\\n function initializeRoleAndGrantToSender(\\n bytes32 adminRole,\\n string calldata description\\n ) external returns (bytes32 role);\\n}\\n\",\"keccak256\":\"0xefd8f27ab9699aa6ed6dd9d13bbc79243af7134e6bf06f578d4bf542db79450c\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/utils/OrderPayable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./interfaces/IOrderPayable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\n\\n/// @title Contract used to pay for orders denoted in the native currency\\n/// @notice OrderPayable is managed by an account that designates order signers\\n/// and withdrawers. Only orders for which a signature is issued for by an\\n/// order signer can be paid for. Order signers have to be EOAs to be able to\\n/// issue ERC191 signatures. The manager is responsible with reverting unwanted\\n/// signatures (for example, if a compromised order signer issues an\\n/// underpriced order and the order is paid for, the manager should revoke the\\n/// role, refund the payment and consider the order void).\\n/// Withdrawers can be EOAs or contracts. For example, one can implement a\\n/// withdrawer contract that withdraws funds automatically to a Funder\\n/// contract.\\ncontract OrderPayable is\\n AccessControlRegistryAdminnedWithManager,\\n IOrderPayable\\n{\\n using ECDSA for bytes32;\\n\\n /// @notice Order signer role description\\n string public constant override ORDER_SIGNER_ROLE_DESCRIPTION =\\n \\\"Order signer\\\";\\n\\n /// @notice Withdrawer role description\\n string public constant override WITHDRAWER_ROLE_DESCRIPTION = \\\"Withdrawer\\\";\\n\\n /// @notice Order signer role\\n bytes32 public immutable override orderSignerRole;\\n\\n /// @notice Withdrawer role\\n bytes32 public immutable override withdrawerRole;\\n\\n /// @notice Returns if the order with ID is paid for\\n mapping(bytes32 => bool) public override orderIdToPaymentStatus;\\n\\n /// @param _accessControlRegistry AccessControlRegistry contract address\\n /// @param _adminRoleDescription Admin role description\\n /// @param _manager Manager address\\n constructor(\\n address _accessControlRegistry,\\n string memory _adminRoleDescription,\\n address _manager\\n )\\n AccessControlRegistryAdminnedWithManager(\\n _accessControlRegistry,\\n _adminRoleDescription,\\n _manager\\n )\\n {\\n orderSignerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n ORDER_SIGNER_ROLE_DESCRIPTION\\n );\\n withdrawerRole = _deriveRole(\\n _deriveAdminRole(manager),\\n WITHDRAWER_ROLE_DESCRIPTION\\n );\\n }\\n\\n /// @notice Called with value to pay for an order\\n /// @dev The sender must set `msg.value` to cover the exact amount\\n /// specified by the order.\\n /// Input arguments are provided in encoded form to improve the UX for\\n /// using ABI-based, automatically generated contract GUIs such as ones\\n /// from Safe and Etherscan. Given that OrderPayable is verified, the user\\n /// is only required to provide the OrderPayable address, select\\n /// `payForOrder()`, copy-paste `encodedData` (instead of 4 separate\\n /// fields) and enter `msg.value`.\\n /// @param encodedData The order ID, expiration timestamp, order signer\\n /// address and signature in ABI-encoded form\\n function payForOrder(bytes calldata encodedData) external payable override {\\n // Do not care if `encodedData` has trailing data\\n (\\n bytes32 orderId,\\n uint256 expirationTimestamp,\\n address orderSigner,\\n bytes memory signature\\n ) = abi.decode(encodedData, (bytes32, uint256, address, bytes));\\n // We do not allow invalid orders even if they are signed by an\\n // authorized order signer\\n require(orderId != bytes32(0), \\\"Order ID zero\\\");\\n require(expirationTimestamp > block.timestamp, \\\"Order expired\\\");\\n require(\\n orderSigner == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n orderSignerRole,\\n orderSigner\\n ),\\n \\\"Invalid order signer\\\"\\n );\\n require(msg.value > 0, \\\"Payment amount zero\\\");\\n require(!orderIdToPaymentStatus[orderId], \\\"Order already paid for\\\");\\n require(\\n (\\n keccak256(\\n abi.encodePacked(\\n block.chainid,\\n address(this),\\n orderId,\\n expirationTimestamp,\\n msg.value\\n )\\n ).toEthSignedMessageHash()\\n ).recover(signature) == orderSigner,\\n \\\"Signature mismatch\\\"\\n );\\n orderIdToPaymentStatus[orderId] = true;\\n emit PaidForOrder(\\n orderId,\\n expirationTimestamp,\\n orderSigner,\\n msg.value,\\n msg.sender\\n );\\n }\\n\\n /// @notice Called by a withdrawer to withdraw the entire balance of\\n /// OrderPayable to `recipient`\\n /// @param recipient Recipient address\\n /// @return amount Withdrawal amount\\n function withdraw(\\n address recipient\\n ) external override returns (uint256 amount) {\\n require(\\n msg.sender == manager ||\\n IAccessControlRegistry(accessControlRegistry).hasRole(\\n withdrawerRole,\\n msg.sender\\n ),\\n \\\"Sender cannot withdraw\\\"\\n );\\n amount = address(this).balance;\\n emit Withdrew(recipient, amount);\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Transfer unsuccessful\\\");\\n }\\n}\\n\",\"keccak256\":\"0xe16d1c14c3643562ac0382f55ae60fdfa599fe461d43f4be6b550ae4ebdab728\",\"license\":\"MIT\"},\"contracts/utils/SelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/ISelfMulticall.sol\\\";\\n\\n/// @title Contract that enables calls to the inheriting contract to be batched\\n/// @notice Implements two ways of batching, one requires none of the calls to\\n/// revert and the other tolerates individual calls reverting\\n/// @dev This implementation uses delegatecall for individual function calls.\\n/// Since delegatecall is a message call, it can only be made to functions that\\n/// are externally visible. This means that a contract cannot multicall its own\\n/// functions that use internal/private visibility modifiers.\\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\\ncontract SelfMulticall is ISelfMulticall {\\n /// @notice Batches calls to the inheriting contract and reverts as soon as\\n /// one of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function multicall(\\n bytes[] calldata data\\n ) external override returns (bytes[] memory returndata) {\\n uint256 callCount = data.length;\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n bool success;\\n // solhint-disable-next-line avoid-low-level-calls\\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\\n if (!success) {\\n bytes memory returndataWithRevertData = returndata[ind];\\n if (returndataWithRevertData.length > 0) {\\n // Adapted from OpenZeppelin's Address.sol\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n let returndata_size := mload(returndataWithRevertData)\\n revert(\\n add(32, returndataWithRevertData),\\n returndata_size\\n )\\n }\\n } else {\\n revert(\\\"Multicall: No revert string\\\");\\n }\\n }\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n\\n /// @notice Batches calls to the inheriting contract but does not revert if\\n /// any of the batched calls reverts\\n /// @param data Array of calldata of batched calls\\n /// @return successes Array of success conditions of batched calls\\n /// @return returndata Array of returndata of batched calls\\n function tryMulticall(\\n bytes[] calldata data\\n )\\n external\\n override\\n returns (bool[] memory successes, bytes[] memory returndata)\\n {\\n uint256 callCount = data.length;\\n successes = new bool[](callCount);\\n returndata = new bytes[](callCount);\\n for (uint256 ind = 0; ind < callCount; ) {\\n // solhint-disable-next-line avoid-low-level-calls\\n (successes[ind], returndata[ind]) = address(this).delegatecall(\\n data[ind]\\n );\\n unchecked {\\n ind++;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb466760f7b5d05a91fb168224952f29db9aa3308f0b83535fd697f3c30281740\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IOrderPayable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOrderPayable {\\n event PaidForOrder(\\n bytes32 indexed orderId,\\n uint256 expirationTimestamp,\\n address orderSigner,\\n uint256 amount,\\n address sender\\n );\\n\\n event Withdrew(address recipient, uint256 amount);\\n\\n function payForOrder(bytes calldata encodedData) external payable;\\n\\n function withdraw(address recipient) external returns (uint256 amount);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function ORDER_SIGNER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function WITHDRAWER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function orderSignerRole() external view returns (bytes32);\\n\\n function withdrawerRole() external view returns (bytes32);\\n\\n function orderIdToPaymentStatus(\\n bytes32 orderId\\n ) external view returns (bool paymentStatus);\\n}\\n\",\"keccak256\":\"0xfeac2c234499724e1bdb185d799f520e7cfe7075b593af1bdb571c8866a2b567\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001a5338038062001a53833981016040819052620000359162000368565b82828282826001600160a01b038216620000895760405162461bcd60e51b815260206004820152601060248201526f4143522061646472657373207a65726f60801b60448201526064015b60405180910390fd5b6000815111620000dc5760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20726f6c65206465736372697074696f6e20656d70747900000000604482015260640162000080565b6001600160a01b0382166080526000620000f78282620004d7565b50806040516020016200010b9190620005a3565b60408051601f19818403018152919052805160209091012060a05250506001600160a01b038116620001805760405162461bcd60e51b815260206004820152601460248201527f4d616e616765722061646472657373207a65726f000000000000000000000000604482015260640162000080565b6001600160a01b03811660c052620001988162000226565b60e052505060c051620001da9150620001b19062000226565b60408051808201909152600c81526b27b93232b91039b4b3b732b960a11b6020820152620002a0565b6101005260c0516200021890620001f19062000226565b60408051808201909152600a8152692bb4ba34323930bbb2b960b11b6020820152620002a0565b6101205250620005c1915050565b60006200029a6200026b836040516001600160601b0319606083901b166020820152600090603401604051602081830303815290604052805190602001209050919050565b60a051604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b92915050565b6000620002dc8383604051602001620002ba9190620005a3565b60405160208183030381529060405280519060200120620002e360201b60201c565b9392505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b80516001600160a01b03811681146200032757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200035f57818101518382015260200162000345565b50506000910152565b6000806000606084860312156200037e57600080fd5b62000389846200030f565b60208501519093506001600160401b0380821115620003a757600080fd5b818601915086601f830112620003bc57600080fd5b815181811115620003d157620003d16200032c565b604051601f8201601f19908116603f01168101908382118183101715620003fc57620003fc6200032c565b816040528281528960208487010111156200041657600080fd5b6200042983602083016020880162000342565b80965050505050506200043f604085016200030f565b90509250925092565b600181811c908216806200045d57607f821691505b6020821081036200047e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620004d257600081815260208120601f850160051c81016020861015620004ad5750805b601f850160051c820191505b81811015620004ce57828155600101620004b9565b5050505b505050565b81516001600160401b03811115620004f357620004f36200032c565b6200050b8162000504845462000448565b8462000484565b602080601f8311600181146200054357600084156200052a5750858301515b600019600386901b1c1916600185901b178555620004ce565b600085815260208120601f198616915b82811015620005745788860151825594840194600190910190840162000553565b5085821015620005935787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251620005b781846020870162000342565b9190910192915050565b60805160a05160c05160e051610100516101205161141c620006376000396000818161031e01526105c0015260008181610274015261089f0152600060e80152600081816101e90152818161058a01526108570152600050506000818161016f015281816105ec01526108d5015261141c6000f3fe6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea26469706673582212201c8673f767e549a40a2e58f8c4b6bdaed945704b7e938b6dab7e0537b628038864736f6c63430008110033", + "deployedBytecode": "0x6080604052600436106100d15760003560e01c806351cff8d91161007f578063a6c2b00b11610059578063a6c2b00b14610296578063ac9650d8146102df578063e8597c371461030c578063f1939bd01461034057600080fd5b806351cff8d91461022d5780639407d9481461024d578063a0205fd51461026257600080fd5b8063437b9116116100b0578063437b9116146101a9578063481c6a75146101d75780634c8f1d8d1461020b57600080fd5b80629f2f3c146100d65780630b383b351461011d5780631ce9ae071461015d575b600080fd5b3480156100e257600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561012957600080fd5b5061014d610138366004610fdc565b60016020526000908152604090205460ff1681565b6040519015158152602001610114565b34801561016957600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b3480156101b557600080fd5b506101c96101c4366004610ff5565b610389565b604051610114929190611108565b3480156101e357600080fd5b506101917f000000000000000000000000000000000000000000000000000000000000000081565b34801561021757600080fd5b506102206104ef565b6040516101149190611161565b34801561023957600080fd5b5061010a610248366004611190565b61057d565b61026061025b3660046111ad565b61079e565b005b34801561026e57600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a257600080fd5b506102206040518060400160405280600c81526020017f4f72646572207369676e6572000000000000000000000000000000000000000081525081565b3480156102eb57600080fd5b506102ff6102fa366004610ff5565b610bc6565b604051610114919061120d565b34801561031857600080fd5b5061010a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034c57600080fd5b506102206040518060400160405280600a81526020017f576974686472617765720000000000000000000000000000000000000000000081525081565b606080828067ffffffffffffffff8111156103a6576103a6611220565b6040519080825280602002602001820160405280156103cf578160200160208202803683370190505b5092508067ffffffffffffffff8111156103eb576103eb611220565b60405190808252806020026020018201604052801561041e57816020015b60608152602001906001900390816104095790505b50915060005b818110156104e6573086868381811061043f5761043f611236565b9050602002810190610451919061124c565b60405161045f929190611293565b600060405180830381855af49150503d806000811461049a576040519150601f19603f3d011682016040523d82523d6000602084013e61049f565b606091505b508583815181106104b2576104b2611236565b602002602001018584815181106104cb576104cb611236565b60209081029190910101919091529015159052600101610424565b50509250929050565b600080546104fc906112a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610528906112a3565b80156105755780601f1061054a57610100808354040283529160200191610575565b820191906000526020600020905b81548152906001019060200180831161055857829003601f168201915b505050505081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061065f5750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906391d1485490604401602060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065f91906112d7565b6106b05760405162461bcd60e51b815260206004820152601660248201527f53656e6465722063616e6e6f742077697468647261770000000000000000000060448201526064015b60405180910390fd5b50604080516001600160a01b03831681524760208201819052917fb244b9a17ad633c6e83b7983ee04320484956a68ddbe96a0b70dfca1cf19d723910160405180910390a16000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610742576040519150601f19603f3d011682016040523d82523d6000602084013e610747565b606091505b50509050806107985760405162461bcd60e51b815260206004820152601560248201527f5472616e7366657220756e7375636365737366756c000000000000000000000060448201526064016106a7565b50919050565b60008080806107af858701876112f9565b92965090945092509050836108065760405162461bcd60e51b815260206004820152600d60248201527f4f72646572204944207a65726f0000000000000000000000000000000000000060448201526064016106a7565b4283116108555760405162461bcd60e51b815260206004820152600d60248201527f4f7264657220657870697265640000000000000000000000000000000000000060448201526064016106a7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614806109405750604051632474521560e21b81527f000000000000000000000000000000000000000000000000000000000000000060048201526001600160a01b0383811660248301527f000000000000000000000000000000000000000000000000000000000000000016906391d1485490604401602060405180830381865afa15801561091c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094091906112d7565b61098c5760405162461bcd60e51b815260206004820152601460248201527f496e76616c6964206f72646572207369676e657200000000000000000000000060448201526064016106a7565b600034116109dc5760405162461bcd60e51b815260206004820152601360248201527f5061796d656e7420616d6f756e74207a65726f0000000000000000000000000060448201526064016106a7565b60008481526001602052604090205460ff1615610a3b5760405162461bcd60e51b815260206004820152601660248201527f4f7264657220616c7265616479207061696420666f720000000000000000000060448201526064016106a7565b604080514660208201526bffffffffffffffffffffffff193060601b169181019190915260548101859052607481018490523460948201526001600160a01b03831690610afa908390610af49060b401604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610d47565b6001600160a01b031614610b505760405162461bcd60e51b815260206004820152601260248201527f5369676e6174757265206d69736d61746368000000000000000000000000000060448201526064016106a7565b600084815260016020818152604092839020805460ff191690921790915581518581526001600160a01b038516918101919091523481830152336060820152905185917fcea2cefca5c9f04181778e454977dc18ae35a22f8bb78043f2edb63a0adf4e9f919081900360800190a2505050505050565b6060818067ffffffffffffffff811115610be257610be2611220565b604051908082528060200260200182016040528015610c1557816020015b6060815260200190600190039081610c005790505b50915060005b81811015610d3f57600030868684818110610c3857610c38611236565b9050602002810190610c4a919061124c565b604051610c58929190611293565b600060405180830381855af49150503d8060008114610c93576040519150601f19603f3d011682016040523d82523d6000602084013e610c98565b606091505b50858481518110610cab57610cab611236565b6020908102919091010152905080610d36576000848381518110610cd157610cd1611236565b60200260200101519050600081511115610cee5780518082602001fd5b60405162461bcd60e51b815260206004820152601b60248201527f4d756c746963616c6c3a204e6f2072657665727420737472696e67000000000060448201526064016106a7565b50600101610c1b565b505092915050565b6000806000610d568585610d6b565b91509150610d6381610db0565b509392505050565b6000808251604103610da15760208301516040840151606085015160001a610d9587828585610f18565b94509450505050610da9565b506000905060025b9250929050565b6000816004811115610dc457610dc46113d0565b03610dcc5750565b6001816004811115610de057610de06113d0565b03610e2d5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016106a7565b6002816004811115610e4157610e416113d0565b03610e8e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016106a7565b6003816004811115610ea257610ea26113d0565b03610f155760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016106a7565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610f4f5750600090506003610fd3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610fa3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610fcc57600060019250925050610fd3565b9150600090505b94509492505050565b600060208284031215610fee57600080fd5b5035919050565b6000806020838503121561100857600080fd5b823567ffffffffffffffff8082111561102057600080fd5b818501915085601f83011261103457600080fd5b81358181111561104357600080fd5b8660208260051b850101111561105857600080fd5b60209290920196919550909350505050565b6000815180845260005b8181101561109057602081850181015186830182015201611074565b506000602082860101526020601f19601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b848110156110fb57601f198684030189526110e983835161106a565b988401989250908301906001016110cd565b5090979650505050505050565b604080825283519082018190526000906020906060840190828701845b82811015611143578151151584529284019290840190600101611125565b5050508381038285015261115781866110b0565b9695505050505050565b602081526000611174602083018461106a565b9392505050565b6001600160a01b0381168114610f1557600080fd5b6000602082840312156111a257600080fd5b81356111748161117b565b600080602083850312156111c057600080fd5b823567ffffffffffffffff808211156111d857600080fd5b818501915085601f8301126111ec57600080fd5b8135818111156111fb57600080fd5b86602082850101111561105857600080fd5b60208152600061117460208301846110b0565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261126357600080fd5b83018035915067ffffffffffffffff82111561127e57600080fd5b602001915036819003821315610da957600080fd5b8183823760009101908152919050565b600181811c908216806112b757607f821691505b60208210810361079857634e487b7160e01b600052602260045260246000fd5b6000602082840312156112e957600080fd5b8151801515811461117457600080fd5b6000806000806080858703121561130f57600080fd5b843593506020850135925060408501356113288161117b565b9150606085013567ffffffffffffffff8082111561134557600080fd5b818701915087601f83011261135957600080fd5b81358181111561136b5761136b611220565b604051601f8201601f19908116603f0116810190838211818310171561139357611393611220565b816040528281528a60208487010111156113ac57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b634e487b7160e01b600052602160045260246000fdfea26469706673582212201c8673f767e549a40a2e58f8c4b6bdaed945704b7e938b6dab7e0537b628038864736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "_accessControlRegistry": "AccessControlRegistry contract address", + "_adminRoleDescription": "Admin role description", + "_manager": "Manager address" + } + }, + "multicall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls" + } + }, + "payForOrder(bytes)": { + "details": "The sender must set `msg.value` to cover the exact amount specified by the order. Input arguments are provided in encoded form to improve the UX for using ABI-based, automatically generated contract GUIs such as ones from Safe and Etherscan. Given that OrderPayable is verified, the user is only required to provide the OrderPayable address, select `payForOrder()`, copy-paste `encodedData` (instead of 4 separate fields) and enter `msg.value`.", + "params": { + "encodedData": "The order ID, expiration timestamp, order signer address and signature in ABI-encoded form" + } + }, + "tryMulticall(bytes[])": { + "params": { + "data": "Array of calldata of batched calls" + }, + "returns": { + "returndata": "Array of returndata of batched calls", + "successes": "Array of success conditions of batched calls" + } + }, + "withdraw(address)": { + "params": { + "recipient": "Recipient address" + }, + "returns": { + "amount": "Withdrawal amount" + } + } + }, + "title": "Contract used to pay for orders denoted in the native currency", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "ORDER_SIGNER_ROLE_DESCRIPTION()": { + "notice": "Order signer role description" + }, + "WITHDRAWER_ROLE_DESCRIPTION()": { + "notice": "Withdrawer role description" + }, + "accessControlRegistry()": { + "notice": "AccessControlRegistry contract address" + }, + "adminRole()": { + "notice": "Admin role" + }, + "adminRoleDescription()": { + "notice": "Admin role description" + }, + "manager()": { + "notice": "Address of the manager that manages the related AccessControlRegistry roles" + }, + "multicall(bytes[])": { + "notice": "Batches calls to the inheriting contract and reverts as soon as one of the batched calls reverts" + }, + "orderIdToPaymentStatus(bytes32)": { + "notice": "Returns if the order with ID is paid for" + }, + "orderSignerRole()": { + "notice": "Order signer role" + }, + "payForOrder(bytes)": { + "notice": "Called with value to pay for an order" + }, + "tryMulticall(bytes[])": { + "notice": "Batches calls to the inheriting contract but does not revert if any of the batched calls reverts" + }, + "withdraw(address)": { + "notice": "Called by a withdrawer to withdraw the entire balance of OrderPayable to `recipient`" + }, + "withdrawerRole()": { + "notice": "Withdrawer role" + } + }, + "notice": "OrderPayable is managed by an account that designates order signers and withdrawers. Only orders for which a signature is issued for by an order signer can be paid for. Order signers have to be EOAs to be able to issue ERC191 signatures. The manager is responsible with reverting unwanted signatures (for example, if a compromised order signer issues an underpriced order and the order is paid for, the manager should revoke the role, refund the payment and consider the order void). Withdrawers can be EOAs or contracts. For example, one can implement a withdrawer contract that withdraws funds automatically to a Funder contract.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 5177, + "contract": "contracts/utils/OrderPayable.sol:OrderPayable", + "label": "adminRoleDescription", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 16190, + "contract": "contracts/utils/OrderPayable.sol:OrderPayable", + "label": "orderIdToPaymentStatus", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_bool)" + } + ], + "types": { + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + } + } + } +} diff --git a/deployments/blast/OwnableCallForwarder.json b/deployments/blast/OwnableCallForwarder.json new file mode 100644 index 00000000..eb40fffc --- /dev/null +++ b/deployments/blast/OwnableCallForwarder.json @@ -0,0 +1,202 @@ +{ + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwardTarget", + "type": "address" + }, + { + "internalType": "bytes", + "name": "forwardedCalldata", + "type": "bytes" + } + ], + "name": "forwardCall", + "outputs": [ + { + "internalType": "bytes", + "name": "returnedData", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x56c8cc0df27086b9bbc0e8f36bf2cac1b454657b1f214ab641a7de071737a353", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "410830", + "logsBloom": "0x00000080000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000040000000000020000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000020000000000000000000010000000000000000000000000000000000000000000000000000010000000000000000020000000000000000000000000000000000080000000000000000000000000000000", + "blockHash": "0x688263b75c08e972b322bc18a1d8afe6cb34f3b07cc1d819f530ef56ee5e8f90", + "transactionHash": "0x56c8cc0df27086b9bbc0e8f36bf2cac1b454657b1f214ab641a7de071737a353", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 114757, + "transactionHash": "0x56c8cc0df27086b9bbc0e8f36bf2cac1b454657b1f214ab641a7de071737a353", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x688263b75c08e972b322bc18a1d8afe6cb34f3b07cc1d819f530ef56ee5e8f90" + }, + { + "transactionIndex": 1, + "blockNumber": 114757, + "transactionHash": "0x56c8cc0df27086b9bbc0e8f36bf2cac1b454657b1f214ab641a7de071737a353", + "address": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000004e59b44847b379578588920ca78fbf26c0b4956c", + "0x00000000000000000000000007b589f06bd0a5324c4e2376d66d2f4f25921de1" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x688263b75c08e972b322bc18a1d8afe6cb34f3b07cc1d819f530ef56ee5e8f90" + } + ], + "blockNumber": 114757, + "cumulativeGasUsed": "461375", + "status": 1, + "byzantium": true + }, + "args": ["0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1"], + "numDeployments": 1, + "solcInputHash": "16343b63dc5abcc6d4d0ea75eb689f42", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwardTarget\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"forwardedCalldata\",\"type\":\"bytes\"}],\"name\":\"forwardCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"returnedData\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"_owner\":\"Owner address\"}},\"forwardCall(address,bytes)\":{\"params\":{\"forwardTarget\":\"Target address that the calldata will be forwarded to\",\"forwardedCalldata\":\"Calldata to be forwarded to the target address\"},\"returns\":{\"returnedData\":\"Data returned by the forwarded call\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Contract that forwards the calls that its owner sends\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"forwardCall(address,bytes)\":{\"notice\":\"Forwards the calldata and the value to the target address if the sender is the owner and returns the data\"}},\"notice\":\"AccessControlRegistry users that want their access control tables to be transferrable (e.g., a DAO) will use this forwarder instead of interacting with it directly. There are cases where this transferrability is not desired, e.g., if the user is an Airnode and is immutably associated with a single address, in which case the manager will interact with AccessControlRegistry directly.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utils/OwnableCallForwarder.sol\":\"OwnableCallForwarder\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"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/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/utils/OwnableCallForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IOwnableCallForwarder.sol\\\";\\n\\n/// @title Contract that forwards the calls that its owner sends\\n/// @notice AccessControlRegistry users that want their access control tables\\n/// to be transferrable (e.g., a DAO) will use this forwarder instead of\\n/// interacting with it directly. There are cases where this transferrability\\n/// is not desired, e.g., if the user is an Airnode and is immutably associated\\n/// with a single address, in which case the manager will interact with\\n/// AccessControlRegistry directly.\\ncontract OwnableCallForwarder is Ownable, IOwnableCallForwarder {\\n /// @param _owner Owner address\\n constructor(address _owner) {\\n transferOwnership(_owner);\\n }\\n\\n /// @notice Forwards the calldata and the value to the target address if\\n /// the sender is the owner and returns the data\\n /// @param forwardTarget Target address that the calldata will be forwarded\\n /// to\\n /// @param forwardedCalldata Calldata to be forwarded to the target address\\n /// @return returnedData Data returned by the forwarded call\\n function forwardCall(\\n address forwardTarget,\\n bytes calldata forwardedCalldata\\n ) external payable override onlyOwner returns (bytes memory returnedData) {\\n returnedData = Address.functionCallWithValue(\\n forwardTarget,\\n forwardedCalldata,\\n msg.value\\n );\\n }\\n}\\n\",\"keccak256\":\"0xcf4e0d53464b7793cdb6d134d6213ba37f8abd8c4e74ccd71d023ba2c4dba691\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IOwnableCallForwarder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOwnableCallForwarder {\\n function forwardCall(\\n address forwardTarget,\\n bytes calldata forwardedCalldata\\n ) external payable returns (bytes memory returnedData);\\n}\\n\",\"keccak256\":\"0x13e5e17e12d5d907f72ac1f52d88592903755edafe1162b7cb68700c93d1ba1c\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5060405161079038038061079083398101604081905261002f91610171565b61003833610047565b61004181610097565b506101a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61009f610115565b6001600160a01b0381166101095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b61011281610047565b50565b6000546001600160a01b0316331461016f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610100565b565b60006020828403121561018357600080fd5b81516001600160a01b038116811461019a57600080fd5b9392505050565b6105e0806101b06000396000f3fe60806040526004361061003f5760003560e01c806322bee49414610044578063715018a61461006d5780638da5cb5b14610084578063f2fde38b146100ac575b600080fd5b61005761005236600461045d565b6100cc565b6040516100649190610530565b60405180910390f35b34801561007957600080fd5b50610082610120565b005b34801561009057600080fd5b506000546040516001600160a01b039091168152602001610064565b3480156100b857600080fd5b506100826100c736600461054a565b610134565b60606100d66101c9565b6101188484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250349250610223915050565b949350505050565b6101286101c9565b6101326000610249565b565b61013c6101c9565b6001600160a01b0381166101bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6101c681610249565b50565b6000546001600160a01b031633146101325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101b4565b6060610118848484604051806060016040528060298152602001610582602991396102b1565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156103295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101b4565b600080866001600160a01b031685876040516103459190610565565b60006040518083038185875af1925050503d8060008114610382576040519150601f19603f3d011682016040523d82523d6000602084013e610387565b606091505b5091509150610398878383876103a3565b979650505050505050565b6060831561041257825160000361040b576001600160a01b0385163b61040b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101b4565b5081610118565b61011883838151156104275781518083602001fd5b8060405162461bcd60e51b81526004016101b49190610530565b80356001600160a01b038116811461045857600080fd5b919050565b60008060006040848603121561047257600080fd5b61047b84610441565b9250602084013567ffffffffffffffff8082111561049857600080fd5b818601915086601f8301126104ac57600080fd5b8135818111156104bb57600080fd5b8760208285010111156104cd57600080fd5b6020830194508093505050509250925092565b60005b838110156104fb5781810151838201526020016104e3565b50506000910152565b6000815180845261051c8160208601602086016104e0565b601f01601f19169290920160200192915050565b6020815260006105436020830184610504565b9392505050565b60006020828403121561055c57600080fd5b61054382610441565b600082516105778184602087016104e0565b919091019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212209bc00d30ca9753335445fb76197730f010383979aa0fd4b393e2e8826680071064736f6c63430008110033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806322bee49414610044578063715018a61461006d5780638da5cb5b14610084578063f2fde38b146100ac575b600080fd5b61005761005236600461045d565b6100cc565b6040516100649190610530565b60405180910390f35b34801561007957600080fd5b50610082610120565b005b34801561009057600080fd5b506000546040516001600160a01b039091168152602001610064565b3480156100b857600080fd5b506100826100c736600461054a565b610134565b60606100d66101c9565b6101188484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250349250610223915050565b949350505050565b6101286101c9565b6101326000610249565b565b61013c6101c9565b6001600160a01b0381166101bd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6101c681610249565b50565b6000546001600160a01b031633146101325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101b4565b6060610118848484604051806060016040528060298152602001610582602991396102b1565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060824710156103295760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016101b4565b600080866001600160a01b031685876040516103459190610565565b60006040518083038185875af1925050503d8060008114610382576040519150601f19603f3d011682016040523d82523d6000602084013e610387565b606091505b5091509150610398878383876103a3565b979650505050505050565b6060831561041257825160000361040b576001600160a01b0385163b61040b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101b4565b5081610118565b61011883838151156104275781518083602001fd5b8060405162461bcd60e51b81526004016101b49190610530565b80356001600160a01b038116811461045857600080fd5b919050565b60008060006040848603121561047257600080fd5b61047b84610441565b9250602084013567ffffffffffffffff8082111561049857600080fd5b818601915086601f8301126104ac57600080fd5b8135818111156104bb57600080fd5b8760208285010111156104cd57600080fd5b6020830194508093505050509250925092565b60005b838110156104fb5781810151838201526020016104e3565b50506000910152565b6000815180845261051c8160208601602086016104e0565b601f01601f19169290920160200192915050565b6020815260006105436020830184610504565b9392505050565b60006020828403121561055c57600080fd5b61054382610441565b600082516105778184602087016104e0565b919091019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a26469706673582212209bc00d30ca9753335445fb76197730f010383979aa0fd4b393e2e8826680071064736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "constructor": { + "params": { + "_owner": "Owner address" + } + }, + "forwardCall(address,bytes)": { + "params": { + "forwardTarget": "Target address that the calldata will be forwarded to", + "forwardedCalldata": "Calldata to be forwarded to the target address" + }, + "returns": { + "returnedData": "Data returned by the forwarded call" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Contract that forwards the calls that its owner sends", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "forwardCall(address,bytes)": { + "notice": "Forwards the calldata and the value to the target address if the sender is the owner and returns the data" + } + }, + "notice": "AccessControlRegistry users that want their access control tables to be transferrable (e.g., a DAO) will use this forwarder instead of interacting with it directly. There are cases where this transferrability is not desired, e.g., if the user is an Airnode and is immutably associated with a single address, in which case the manager will interact with AccessControlRegistry directly.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 396, + "contract": "contracts/utils/OwnableCallForwarder.sol:OwnableCallForwarder", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/blast/ProxyFactory.json b/deployments/blast/ProxyFactory.json new file mode 100644 index 00000000..69503818 --- /dev/null +++ b/deployments/blast/ProxyFactory.json @@ -0,0 +1,501 @@ +{ + "address": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_api3ServerV1", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDapiProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDapiProxyWithOev", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDataFeedProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "DeployedDataFeedProxyWithOev", + "type": "event" + }, + { + "inputs": [], + "name": "api3ServerV1", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDapiProxyAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDapiProxyWithOevAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDataFeedProxyAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "computeDataFeedProxyWithOevAddress", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxy", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dapiName", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDapiProxyWithOev", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDataFeedProxy", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataFeedId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "oevBeneficiary", + "type": "address" + }, + { + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "deployDataFeedProxyWithOev", + "outputs": [ + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xff1170869658fd4785749a2f45e64f9f201a7b12831cc489d5d1d43cd2e46d7e", + "receipt": { + "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", + "from": "0x07b589f06bD0A5324c4E2376d66d2F4F25921DE1", + "contractAddress": null, + "transactionIndex": 1, + "gasUsed": "1473171", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xb68fef47566aaf0f9c6644dec914b785ff17b8a108014828a15e5f1061fe4b99", + "transactionHash": "0xff1170869658fd4785749a2f45e64f9f201a7b12831cc489d5d1d43cd2e46d7e", + "logs": [], + "blockNumber": 114806, + "cumulativeGasUsed": "1523716", + "status": 1, + "byzantium": true + }, + "args": ["0x709944a48cAf83535e43471680fDA4905FB3920a"], + "numDeployments": 1, + "solcInputHash": "16343b63dc5abcc6d4d0ea75eb689f42", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_api3ServerV1\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDapiProxy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDapiProxyWithOev\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDataFeedProxy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"DeployedDataFeedProxyWithOev\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"api3ServerV1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDapiProxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDapiProxyWithOevAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDataFeedProxyAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"computeDataFeedProxyWithOevAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dapiName\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDapiProxyWithOev\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDataFeedProxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"dataFeedId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"oevBeneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"metadata\",\"type\":\"bytes\"}],\"name\":\"deployDataFeedProxyWithOev\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxyAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The proxies are deployed normally and not cloned to minimize the gas cost overhead while using them to read data feed values\",\"kind\":\"dev\",\"methods\":{\"computeDapiProxyAddress(bytes32,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDapiProxyWithOevAddress(bytes32,address,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDataFeedProxyAddress(bytes32,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"computeDataFeedProxyWithOevAddress(bytes32,address,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"constructor\":{\"params\":{\"_api3ServerV1\":\"Api3ServerV1 address\"}},\"deployDapiProxy(bytes32,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"params\":{\"dapiName\":\"dAPI name\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDataFeedProxy(bytes32,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}},\"deployDataFeedProxyWithOev(bytes32,address,bytes)\":{\"params\":{\"dataFeedId\":\"Data feed ID\",\"metadata\":\"Metadata associated with the proxy\",\"oevBeneficiary\":\"OEV beneficiary\"},\"returns\":{\"proxyAddress\":\"Proxy address\"}}},\"title\":\"Contract factory that deterministically deploys proxies that read data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV support\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"api3ServerV1()\":{\"notice\":\"Api3ServerV1 address\"},\"computeDapiProxyAddress(bytes32,bytes)\":{\"notice\":\"Computes the address of the dAPI proxy\"},\"computeDapiProxyWithOevAddress(bytes32,address,bytes)\":{\"notice\":\"Computes the address of the dAPI proxy with OEV support\"},\"computeDataFeedProxyAddress(bytes32,bytes)\":{\"notice\":\"Computes the address of the data feed proxy\"},\"computeDataFeedProxyWithOevAddress(bytes32,address,bytes)\":{\"notice\":\"Computes the address of the data feed proxy with OEV support\"},\"deployDapiProxy(bytes32,bytes)\":{\"notice\":\"Deterministically deploys a dAPI proxy\"},\"deployDapiProxyWithOev(bytes32,address,bytes)\":{\"notice\":\"Deterministically deploys a dAPI proxy with OEV support\"},\"deployDataFeedProxy(bytes32,bytes)\":{\"notice\":\"Deterministically deploys a data feed proxy\"},\"deployDataFeedProxyWithOev(bytes32,address,bytes)\":{\"notice\":\"Deterministically deploys a data feed proxy with OEV support\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/api3-server-v1/proxies/ProxyFactory.sol\":\"ProxyFactory\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Create2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Create2.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\\n * `CREATE2` can be used to compute in advance the address where a smart\\n * contract will be deployed, which allows for interesting new mechanisms known\\n * as 'counterfactual interactions'.\\n *\\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\\n * information.\\n */\\nlibrary Create2 {\\n /**\\n * @dev Deploys a contract using `CREATE2`. The address where the contract\\n * will be deployed can be known in advance via {computeAddress}.\\n *\\n * The bytecode for a contract can be obtained from Solidity with\\n * `type(contractName).creationCode`.\\n *\\n * Requirements:\\n *\\n * - `bytecode` must not be empty.\\n * - `salt` must have not been used for `bytecode` already.\\n * - the factory must have a balance of at least `amount`.\\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\\n */\\n function deploy(\\n uint256 amount,\\n bytes32 salt,\\n bytes memory bytecode\\n ) internal returns (address addr) {\\n require(address(this).balance >= amount, \\\"Create2: insufficient balance\\\");\\n require(bytecode.length != 0, \\\"Create2: bytecode length is zero\\\");\\n /// @solidity memory-safe-assembly\\n assembly {\\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\\n }\\n require(addr != address(0), \\\"Create2: Failed on deploy\\\");\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\\n * `bytecodeHash` or `salt` will result in a new destination address.\\n */\\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\\n return computeAddress(salt, bytecodeHash, address(this));\\n }\\n\\n /**\\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\\n */\\n function computeAddress(\\n bytes32 salt,\\n bytes32 bytecodeHash,\\n address deployer\\n ) internal pure returns (address addr) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n let ptr := mload(0x40) // Get free memory pointer\\n\\n // | | \\u2193 ptr ... \\u2193 ptr + 0x0B (start) ... \\u2193 ptr + 0x20 ... \\u2193 ptr + 0x40 ... |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\\n // | salt | BBBBBBBBBBBBB...BB |\\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\\n // | 0xFF | FF |\\n // |-------------------|---------------------------------------------------------------------------|\\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\\n // | keccak(start, 85) | \\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191\\u2191 |\\n\\n mstore(add(ptr, 0x40), bytecodeHash)\\n mstore(add(ptr, 0x20), salt)\\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\\n mstore8(start, 0xff)\\n addr := keccak256(start, 85)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xafc07f37809f74d9c66d6461cc0f85fb5147ab855acd0acc30af4b2272130c61\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/ISelfMulticall.sol\\\";\\n\\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\\n function accessControlRegistry() external view returns (address);\\n\\n function adminRoleDescription() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xd71aae2566c019a9b2da5e1ec51421a62898495fa6fd08e2cc39451511dda334\",\"license\":\"MIT\"},\"contracts/access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlRegistryAdminned.sol\\\";\\n\\ninterface IAccessControlRegistryAdminnedWithManager is\\n IAccessControlRegistryAdminned\\n{\\n function manager() external view returns (address);\\n\\n function adminRole() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x8a8e1756fca81175305755b7a311536132e88173f60b2ac0fdeef92a6236afc5\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IApi3ServerV1.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDapiServer.sol\\\";\\nimport \\\"./IBeaconUpdatesWithSignedData.sol\\\";\\n\\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\\n function readDataFeedWithId(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHash(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithIdAsOevProxy(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function readDataFeedWithDapiNameHashAsOevProxy(\\n bytes32 dapiNameHash\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function dataFeeds(\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n\\n function oevProxyToIdToDataFeed(\\n address proxy,\\n bytes32 dataFeedId\\n ) external view returns (int224 value, uint32 timestamp);\\n}\\n\",\"keccak256\":\"0xea2c05eaf2a19c93a9c9b08243fcabd8d7fcf0e4d422f7c687aef693126c1809\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\\n function updateBeaconWithSignedData(\\n address airnode,\\n bytes32 templateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes calldata signature\\n ) external returns (bytes32 beaconId);\\n}\\n\",\"keccak256\":\"0xe2b2530081508baf1323d4c145a688ffd548cf318a8cb67c9ccb4abe1ac81c6e\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\\\";\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IDapiServer is\\n IAccessControlRegistryAdminnedWithManager,\\n IDataFeedServer\\n{\\n event SetDapiName(\\n bytes32 indexed dataFeedId,\\n bytes32 indexed dapiName,\\n address sender\\n );\\n\\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\\n\\n function dapiNameToDataFeedId(\\n bytes32 dapiName\\n ) external view returns (bytes32);\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\\n external\\n view\\n returns (string memory);\\n\\n function dapiNameSetterRole() external view returns (bytes32);\\n\\n function dapiNameHashToDataFeedId(\\n bytes32 dapiNameHash\\n ) external view returns (bytes32 dataFeedId);\\n}\\n\",\"keccak256\":\"0x61cd079ceb84d2b7414b82da71f4f000e52a0a1429065ec666e77ef6e5f21ea1\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/interfaces/IExtendedSelfMulticall.sol\\\";\\n\\ninterface IDataFeedServer is IExtendedSelfMulticall {\\n event UpdatedBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedBeaconSetWithBeacons(\\n bytes32 indexed beaconSetId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n function updateBeaconSetWithBeacons(\\n bytes32[] memory beaconIds\\n ) external returns (bytes32 beaconSetId);\\n}\\n\",\"keccak256\":\"0x208f751f71b16d454cafd9188095178fdc776ee0376a85362f6022e7a4f010a3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDapiServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IOevDataFeedServer.sol\\\";\\nimport \\\"./IDapiServer.sol\\\";\\n\\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\\n\",\"keccak256\":\"0xf4082c33979785131358a217a8c5cf498a53c04318868eb1cb68e934c33226e3\",\"license\":\"MIT\"},\"contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IDataFeedServer.sol\\\";\\n\\ninterface IOevDataFeedServer is IDataFeedServer {\\n event UpdatedOevProxyBeaconWithSignedData(\\n bytes32 indexed beaconId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event UpdatedOevProxyBeaconSetWithSignedData(\\n bytes32 indexed beaconSetId,\\n address indexed proxy,\\n bytes32 indexed updateId,\\n int224 value,\\n uint32 timestamp\\n );\\n\\n event Withdrew(\\n address indexed oevProxy,\\n address oevBeneficiary,\\n uint256 amount\\n );\\n\\n function updateOevProxyDataFeedWithSignedData(\\n address oevProxy,\\n bytes32 dataFeedId,\\n bytes32 updateId,\\n uint256 timestamp,\\n bytes calldata data,\\n bytes[] calldata packedOevUpdateSignatures\\n ) external payable;\\n\\n function withdraw(address oevProxy) external;\\n\\n function oevProxyToBalance(\\n address oevProxy\\n ) external view returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x2d162c576bfe5554767bb48758314c3e6f2c509f73203f0e166d1ac5168a1218\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DapiProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/IDapiProxy.sol\\\";\\nimport \\\"../interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific dAPI of\\n/// a specific Api3ServerV1 contract\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev The proxy contracts are generalized to support most types of numerical\\n/// data feeds. This means that the user of this proxy is expected to validate\\n/// the read values according to the specific use-case. For example, `value` is\\n/// a signed integer, yet it being negative may not make sense in the case that\\n/// the data feed represents the spot price of an asset. In that case, the user\\n/// is responsible with ensuring that `value` is not negative.\\n/// In the case that the data feed is from a single source, `timestamp` is the\\n/// system time of the Airnode when it signed the data. In the case that the\\n/// data feed is from multiple sources, `timestamp` is the median of system\\n/// times of the Airnodes when they signed the respective data. There are two\\n/// points to consider while using `timestamp` in your contract logic: (1) It\\n/// is based on the system time of the Airnodes, and not the block timestamp.\\n/// This may be relevant when either of them drifts. (2) `timestamp` is an\\n/// off-chain value that is being reported, similar to `value`. Both should\\n/// only be trusted as much as the Airnode(s) that report them.\\ncontract DapiProxy is IDapiProxy {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n /// @notice Hash of the dAPI name\\n bytes32 public immutable override dapiNameHash;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dapiNameHash Hash of the dAPI name\\n constructor(address _api3ServerV1, bytes32 _dapiNameHash) {\\n api3ServerV1 = _api3ServerV1;\\n dapiNameHash = _dapiNameHash;\\n }\\n\\n /// @notice Reads the dAPI that this proxy maps to\\n /// @return value dAPI value\\n /// @return timestamp dAPI timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithDapiNameHash(dapiNameHash);\\n }\\n}\\n\",\"keccak256\":\"0x7bda11348ffff6be0621803c2ef1e146b9abd55e9b6f35a71392b2ecbf18f8ea\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DapiProxyWithOev.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DapiProxy.sol\\\";\\nimport \\\"./interfaces/IOevProxy.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific dAPI of\\n/// a specific Api3ServerV1 contract and inform Api3ServerV1 about the\\n/// beneficiary of the respective OEV proceeds\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DapiProxyWithOev is DapiProxy, IOevProxy {\\n /// @notice OEV beneficiary address\\n address public immutable override oevBeneficiary;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dapiNameHash Hash of the dAPI name\\n /// @param _oevBeneficiary OEV beneficiary\\n constructor(\\n address _api3ServerV1,\\n bytes32 _dapiNameHash,\\n address _oevBeneficiary\\n ) DapiProxy(_api3ServerV1, _dapiNameHash) {\\n oevBeneficiary = _oevBeneficiary;\\n }\\n\\n /// @notice Reads the dAPI that this proxy maps to\\n /// @return value dAPI value\\n /// @return timestamp dAPI timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\\n }\\n}\\n\",\"keccak256\":\"0x1ebe7b44c0e49d9afc942dc1beea2a0c42ad79bb514086ea9e74d027ec7237c9\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DataFeedProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./interfaces/IDataFeedProxy.sol\\\";\\nimport \\\"../interfaces/IApi3ServerV1.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific data\\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DataFeedProxy is IDataFeedProxy {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n /// @notice Data feed ID\\n bytes32 public immutable override dataFeedId;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\\n constructor(address _api3ServerV1, bytes32 _dataFeedId) {\\n api3ServerV1 = _api3ServerV1;\\n dataFeedId = _dataFeedId;\\n }\\n\\n /// @notice Reads the data feed that this proxy maps to\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1).readDataFeedWithId(\\n dataFeedId\\n );\\n }\\n}\\n\",\"keccak256\":\"0x955b09a7777f4c80ebcff66a7e685459b0308a94eb6faf78757274e9dff643d4\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/DataFeedProxyWithOev.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DataFeedProxy.sol\\\";\\nimport \\\"./interfaces/IOevProxy.sol\\\";\\n\\n/// @title An immutable proxy contract that is used to read a specific data\\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract and inform\\n/// Api3ServerV1 about the beneficiary of the respective OEV proceeds\\n/// @notice In an effort to reduce the bytecode of this contract, its\\n/// constructor arguments are validated by ProxyFactory, rather than\\n/// internally. If you intend to deploy this contract without using\\n/// ProxyFactory, you are recommended to implement an equivalent validation.\\n/// @dev See DapiProxy.sol for comments about usage\\ncontract DataFeedProxyWithOev is DataFeedProxy, IOevProxy {\\n /// @notice OEV beneficiary address\\n address public immutable override oevBeneficiary;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\\n /// @param _oevBeneficiary OEV beneficiary\\n constructor(\\n address _api3ServerV1,\\n bytes32 _dataFeedId,\\n address _oevBeneficiary\\n ) DataFeedProxy(_api3ServerV1, _dataFeedId) {\\n oevBeneficiary = _oevBeneficiary;\\n }\\n\\n /// @notice Reads the data feed that this proxy maps to\\n /// @return value Data feed value\\n /// @return timestamp Data feed timestamp\\n function read()\\n external\\n view\\n virtual\\n override\\n returns (int224 value, uint32 timestamp)\\n {\\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\\n .readDataFeedWithIdAsOevProxy(dataFeedId);\\n }\\n}\\n\",\"keccak256\":\"0xad9ccf4ed36a49e13da6a84bf617b22888d0c5b3db737c139609ee322aa4bff8\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/ProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./DataFeedProxy.sol\\\";\\nimport \\\"./DapiProxy.sol\\\";\\nimport \\\"./DataFeedProxyWithOev.sol\\\";\\nimport \\\"./DapiProxyWithOev.sol\\\";\\nimport \\\"./interfaces/IProxyFactory.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/Create2.sol\\\";\\n\\n/// @title Contract factory that deterministically deploys proxies that read\\n/// data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV\\n/// support\\n/// @dev The proxies are deployed normally and not cloned to minimize the gas\\n/// cost overhead while using them to read data feed values\\ncontract ProxyFactory is IProxyFactory {\\n /// @notice Api3ServerV1 address\\n address public immutable override api3ServerV1;\\n\\n /// @param _api3ServerV1 Api3ServerV1 address\\n constructor(address _api3ServerV1) {\\n require(_api3ServerV1 != address(0), \\\"Api3ServerV1 address zero\\\");\\n api3ServerV1 = _api3ServerV1;\\n }\\n\\n /// @notice Deterministically deploys a data feed proxy\\n /// @param dataFeedId Data feed ID\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDataFeedProxy(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n proxyAddress = address(\\n new DataFeedProxy{salt: keccak256(metadata)}(\\n api3ServerV1,\\n dataFeedId\\n )\\n );\\n emit DeployedDataFeedProxy(proxyAddress, dataFeedId, metadata);\\n }\\n\\n /// @notice Deterministically deploys a dAPI proxy\\n /// @param dapiName dAPI name\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n proxyAddress = address(\\n new DapiProxy{salt: keccak256(metadata)}(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName))\\n )\\n );\\n emit DeployedDapiProxy(proxyAddress, dapiName, metadata);\\n }\\n\\n /// @notice Deterministically deploys a data feed proxy with OEV support\\n /// @param dataFeedId Data feed ID\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDataFeedProxyWithOev(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = address(\\n new DataFeedProxyWithOev{salt: keccak256(metadata)}(\\n api3ServerV1,\\n dataFeedId,\\n oevBeneficiary\\n )\\n );\\n emit DeployedDataFeedProxyWithOev(\\n proxyAddress,\\n dataFeedId,\\n oevBeneficiary,\\n metadata\\n );\\n }\\n\\n /// @notice Deterministically deploys a dAPI proxy with OEV support\\n /// @param dapiName dAPI name\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = address(\\n new DapiProxyWithOev{salt: keccak256(metadata)}(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName)),\\n oevBeneficiary\\n )\\n );\\n emit DeployedDapiProxyWithOev(\\n proxyAddress,\\n dapiName,\\n oevBeneficiary,\\n metadata\\n );\\n }\\n\\n /// @notice Computes the address of the data feed proxy\\n /// @param dataFeedId Data feed ID\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDataFeedProxyAddress(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DataFeedProxy).creationCode,\\n abi.encode(api3ServerV1, dataFeedId)\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the dAPI proxy\\n /// @param dapiName dAPI name\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDapiProxyAddress(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DapiProxy).creationCode,\\n abi.encode(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName))\\n )\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the data feed proxy with OEV support\\n /// @param dataFeedId Data feed ID\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDataFeedProxyWithOevAddress(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dataFeedId != bytes32(0), \\\"Data feed ID zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DataFeedProxyWithOev).creationCode,\\n abi.encode(api3ServerV1, dataFeedId, oevBeneficiary)\\n )\\n )\\n );\\n }\\n\\n /// @notice Computes the address of the dAPI proxy with OEV support\\n /// @param dapiName dAPI name\\n /// @param oevBeneficiary OEV beneficiary\\n /// @param metadata Metadata associated with the proxy\\n /// @return proxyAddress Proxy address\\n function computeDapiProxyWithOevAddress(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view override returns (address proxyAddress) {\\n require(dapiName != bytes32(0), \\\"dAPI name zero\\\");\\n require(oevBeneficiary != address(0), \\\"OEV beneficiary zero\\\");\\n proxyAddress = Create2.computeAddress(\\n keccak256(metadata),\\n keccak256(\\n abi.encodePacked(\\n type(DapiProxyWithOev).creationCode,\\n abi.encode(\\n api3ServerV1,\\n keccak256(abi.encodePacked(dapiName)),\\n oevBeneficiary\\n )\\n )\\n )\\n );\\n }\\n}\\n\",\"keccak256\":\"0x044df7d743f5797b23e17e53e54f428164193a44eb51c6c20293e796621623bd\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IDapiProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IProxy.sol\\\";\\n\\ninterface IDapiProxy is IProxy {\\n function dapiNameHash() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x7fee704659b2fd4629ce105b686284bb922f73d2261b04ad927f8e4b54479409\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IDataFeedProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IProxy.sol\\\";\\n\\ninterface IDataFeedProxy is IProxy {\\n function dataFeedId() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x114b4d530c3aa4e9359d7d4596170068b294d65ead405dc590b120e991d7b587\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOevProxy {\\n function oevBeneficiary() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcd9962a465c96e85638eb40775da008f9c86a0ea0c50c7c5fcbb11c55f48fc22\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @dev See DapiProxy.sol for comments about usage\\ninterface IProxy {\\n function read() external view returns (int224 value, uint32 timestamp);\\n\\n function api3ServerV1() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3ad69ef6ff3de4056ec43eb8b47465f3d896f88e95cfffb909a6d057b91db17b\",\"license\":\"MIT\"},\"contracts/api3-server-v1/proxies/interfaces/IProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IProxyFactory {\\n event DeployedDataFeedProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxy(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n bytes metadata\\n );\\n\\n event DeployedDataFeedProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dataFeedId,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n event DeployedDapiProxyWithOev(\\n address indexed proxyAddress,\\n bytes32 indexed dapiName,\\n address oevBeneficiary,\\n bytes metadata\\n );\\n\\n function deployDataFeedProxy(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxy(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDataFeedProxyWithOev(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function deployDapiProxyWithOev(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external returns (address proxyAddress);\\n\\n function computeDataFeedProxyAddress(\\n bytes32 dataFeedId,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyAddress(\\n bytes32 dapiName,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDataFeedProxyWithOevAddress(\\n bytes32 dataFeedId,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function computeDapiProxyWithOevAddress(\\n bytes32 dapiName,\\n address oevBeneficiary,\\n bytes calldata metadata\\n ) external view returns (address proxyAddress);\\n\\n function api3ServerV1() external view returns (address);\\n}\\n\",\"keccak256\":\"0x60b3b838b94ead5e5760a897053236ce20954a616a6892c7088ad1cf851290a1\",\"license\":\"MIT\"},\"contracts/utils/interfaces/IExtendedSelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISelfMulticall.sol\\\";\\n\\ninterface IExtendedSelfMulticall is ISelfMulticall {\\n function getChainId() external view returns (uint256);\\n\\n function getBalance(address account) external view returns (uint256);\\n\\n function containsBytecode(address account) external view returns (bool);\\n\\n function getBlockNumber() external view returns (uint256);\\n\\n function getBlockTimestamp() external view returns (uint256);\\n\\n function getBlockBasefee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xaefe61a623c920d3e39c4779535e280378b44202d11c29a2c96f46f2fe5f420d\",\"license\":\"MIT\"},\"contracts/utils/interfaces/ISelfMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface ISelfMulticall {\\n function multicall(\\n bytes[] calldata data\\n ) external returns (bytes[] memory returndata);\\n\\n function tryMulticall(\\n bytes[] calldata data\\n ) external returns (bool[] memory successes, bytes[] memory returndata);\\n}\\n\",\"keccak256\":\"0x50b27284f0d5acd8b340836c09d252138ebf059f426e5d90d3f7221e1b7d0817\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b50604051611ae1380380611ae183398101604081905261002f9161009a565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601960248201527f4170693353657276657256312061646472657373207a65726f00000000000000604482015260640160405180910390fd5b6001600160a01b03166080526100ca565b6000602082840312156100ac57600080fd5b81516001600160a01b03811681146100c357600080fd5b9392505050565b6080516119c561011c6000396000818160ad0152818161020b0152818161032901528181610501015281816105a4015281816106fd01528181610805015281816109a60152610a7d01526119c56000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c80637dba7458116100765780639ae06c841161005b5780639ae06c841461014a578063d67564bd1461015d578063da1b7d0f1461017057600080fd5b80637dba7458146101245780638dae1a471461013757600080fd5b80632d6a744e146100a857806350763e84146100eb5780635849e5ef146100fe5780636c9d6c0914610111575b600080fd5b6100cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100cf6100f9366004610b72565b610183565b6100cf61010c366004610bbe565b610282565b6100cf61011f366004610bbe565b61040f565b6100cf610132366004610b72565b610547565b6100cf610145366004610bbe565b610653565b6100cf610158366004610b72565b6107ab565b6100cf61016b366004610bbe565b6108cd565b6100cf61017e366004610b72565b6109e1565b6000836101cb5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064015b60405180910390fd5b61027a83836040516101de929190610c26565b604051908190038120906101f460208201610af5565b601f1982820381018352601f9091011660408181527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602083015281018890526060015b60408051601f198184030181529082905261025f9291602001610c66565b60405160208183030381529060405280519060200120610ab7565b949350505050565b6000846102c25760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661030f5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b828260405161031f929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008660405160200161035b91815260200190565b604051602081830303815290604052805190602001208660405161037e90610b02565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f59050801580156103be573d6000803e3d6000fd5b50905084816001600160a01b03167f31d654553da13df7303eb8db83942ff8816845087d3149515a220f5afb37aedd8686866040516103ff93929190610ca4565b60405180910390a3949350505050565b60008461044f5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661049c5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e83836040516104af929190610c26565b604051908190038120906104c560208201610b02565b818103601f199081018352601f90910116604081815260208083018b905281518084038201815282840190925281519101206001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660608401526080830191909152881660a082015260c001610241565b95945050505050565b60008361058a5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b828260405161059a929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000856040516105d090610af5565b6001600160a01b03909216825260208201526040018190604051809103906000f5905080158015610605573d6000803e3d6000fd5b50905083816001600160a01b03167f9a2a9d77287e93a2addaf0c5f3e354d075dfb475f5e197f9abc9b11b922fa9438585604051610644929190610cc7565b60405180910390a39392505050565b6000846106965760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b0384166106e35760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b82826040516106f3929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000868660405161072a90610b0f565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f590508015801561076a573d6000803e3d6000fd5b50905084816001600160a01b03167fff915717e95cf852fef69474bc2bfb3c26ccc15a6978a90ab0a78bc565644d4e8686866040516103ff93929190610ca4565b6000836107eb5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b82826040516107fb929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008560405160200161083791815260200190565b6040516020818303038152906040528051906020012060405161085990610b1c565b6001600160a01b03909216825260208201526040018190604051809103906000f590508015801561088e573d6000803e3d6000fd5b50905083816001600160a01b03167f5212a04ae578b0432469e3d61a28f222c00cf2f5e14d69b0f08c7d327b623d1d8585604051610644929190610cc7565b6000846109105760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b03841661095d5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e8383604051610970929190610c26565b6040519081900381209061098660208201610b0f565b818103601f199081018352601f9091011660408181526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660208401529082018a905288166060820152608001610241565b600083610a215760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b61027a8383604051610a34929190610c26565b60405190819003812090610a4a60208201610b1c565b601f1982820381018352601f90910116604081815260208083018a905281518084038201815282840190925281519101207f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166060830152608082015260a001610241565b6000610ac4838330610acb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6102fd80610cdc83390190565b61035d80610fd983390190565b61035d8061133683390190565b6102fd8061169383390190565b60008083601f840112610b3b57600080fd5b50813567ffffffffffffffff811115610b5357600080fd5b602083019150836020828501011115610b6b57600080fd5b9250929050565b600080600060408486031215610b8757600080fd5b83359250602084013567ffffffffffffffff811115610ba557600080fd5b610bb186828701610b29565b9497909650939450505050565b60008060008060608587031215610bd457600080fd5b8435935060208501356001600160a01b0381168114610bf257600080fd5b9250604085013567ffffffffffffffff811115610c0e57600080fd5b610c1a87828801610b29565b95989497509550505050565b8183823760009101908152919050565b6000815160005b81811015610c575760208185018101518683015201610c3d565b50600093019283525090919050565b600061027a610c758386610c36565b84610c36565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820152600061053e604083018486610c7b565b60208152600061027a602083018486610c7b56fe60c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b060003960008181609c015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e14610046578063370c826b1461009757806357de26a4146100cc575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6100d46100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6040517fa5fc076f0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a5fc076f906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212204c00c55f37d9d93afc24a97a86b86c67275c3e6f0288edd31c678400d06b4dcc64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160f5015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160ce015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a2578063370c826b146100c957806357de26a4146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b610106610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6040517fcfaf49710000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063cfaf4971906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220491c4b81100c410951a4eacc896ef33bf2f2865d87768147c4ca7217d63d79c864736f6c6343000811003360c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b06000396000818160c3015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e1461004657806357de26a414610097578063dcf8da92146100be575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009f6100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6100e57f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6040517fb62408a30000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b62408a3906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212201d061d50f160b049953a990ae61794869544bc65e5a0d25812e444c431cb90f964736f6c63430008110033a2646970667358221220c65d86e8fe1882ee9717fe8fadf286e2319482a7213942b09ed85c68e3cb244164736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a35760003560e01c80637dba7458116100765780639ae06c841161005b5780639ae06c841461014a578063d67564bd1461015d578063da1b7d0f1461017057600080fd5b80637dba7458146101245780638dae1a471461013757600080fd5b80632d6a744e146100a857806350763e84146100eb5780635849e5ef146100fe5780636c9d6c0914610111575b600080fd5b6100cf7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100cf6100f9366004610b72565b610183565b6100cf61010c366004610bbe565b610282565b6100cf61011f366004610bbe565b61040f565b6100cf610132366004610b72565b610547565b6100cf610145366004610bbe565b610653565b6100cf610158366004610b72565b6107ab565b6100cf61016b366004610bbe565b6108cd565b6100cf61017e366004610b72565b6109e1565b6000836101cb5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064015b60405180910390fd5b61027a83836040516101de929190610c26565b604051908190038120906101f460208201610af5565b601f1982820381018352601f9091011660408181527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602083015281018890526060015b60408051601f198184030181529082905261025f9291602001610c66565b60405160208183030381529060405280519060200120610ab7565b949350505050565b6000846102c25760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661030f5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b828260405161031f929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008660405160200161035b91815260200190565b604051602081830303815290604052805190602001208660405161037e90610b02565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f59050801580156103be573d6000803e3d6000fd5b50905084816001600160a01b03167f31d654553da13df7303eb8db83942ff8816845087d3149515a220f5afb37aedd8686866040516103ff93929190610ca4565b60405180910390a3949350505050565b60008461044f5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b6001600160a01b03841661049c5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e83836040516104af929190610c26565b604051908190038120906104c560208201610b02565b818103601f199081018352601f90910116604081815260208083018b905281518084038201815282840190925281519101206001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660608401526080830191909152881660a082015260c001610241565b95945050505050565b60008361058a5760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b828260405161059a929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000856040516105d090610af5565b6001600160a01b03909216825260208201526040018190604051809103906000f5905080158015610605573d6000803e3d6000fd5b50905083816001600160a01b03167f9a2a9d77287e93a2addaf0c5f3e354d075dfb475f5e197f9abc9b11b922fa9438585604051610644929190610cc7565b60405180910390a39392505050565b6000846106965760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b0384166106e35760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b82826040516106f3929190610c26565b60405180910390207f0000000000000000000000000000000000000000000000000000000000000000868660405161072a90610b0f565b6001600160a01b039384168152602081019290925290911660408201526060018190604051809103906000f590508015801561076a573d6000803e3d6000fd5b50905084816001600160a01b03167fff915717e95cf852fef69474bc2bfb3c26ccc15a6978a90ab0a78bc565644d4e8686866040516103ff93929190610ca4565b6000836107eb5760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b82826040516107fb929190610c26565b60405180910390207f00000000000000000000000000000000000000000000000000000000000000008560405160200161083791815260200190565b6040516020818303038152906040528051906020012060405161085990610b1c565b6001600160a01b03909216825260208201526040018190604051809103906000f590508015801561088e573d6000803e3d6000fd5b50905083816001600160a01b03167f5212a04ae578b0432469e3d61a28f222c00cf2f5e14d69b0f08c7d327b623d1d8585604051610644929190610cc7565b6000846109105760405162461bcd60e51b8152602060048201526011602482015270446174612066656564204944207a65726f60781b60448201526064016101c2565b6001600160a01b03841661095d5760405162461bcd60e51b81526020600482015260146024820152734f45562062656e6566696369617279207a65726f60601b60448201526064016101c2565b61053e8383604051610970929190610c26565b6040519081900381209061098660208201610b0f565b818103601f199081018352601f9091011660408181526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660208401529082018a905288166060820152608001610241565b600083610a215760405162461bcd60e51b815260206004820152600e60248201526d64415049206e616d65207a65726f60901b60448201526064016101c2565b61027a8383604051610a34929190610c26565b60405190819003812090610a4a60208201610b1c565b601f1982820381018352601f90910116604081815260208083018a905281518084038201815282840190925281519101207f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166060830152608082015260a001610241565b6000610ac4838330610acb565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6102fd80610cdc83390190565b61035d80610fd983390190565b61035d8061133683390190565b6102fd8061169383390190565b60008083601f840112610b3b57600080fd5b50813567ffffffffffffffff811115610b5357600080fd5b602083019150836020828501011115610b6b57600080fd5b9250929050565b600080600060408486031215610b8757600080fd5b83359250602084013567ffffffffffffffff811115610ba557600080fd5b610bb186828701610b29565b9497909650939450505050565b60008060008060608587031215610bd457600080fd5b8435935060208501356001600160a01b0381168114610bf257600080fd5b9250604085013567ffffffffffffffff811115610c0e57600080fd5b610c1a87828801610b29565b95989497509550505050565b8183823760009101908152919050565b6000815160005b81811015610c575760208185018101518683015201610c3d565b50600093019283525090919050565b600061027a610c758386610c36565b84610c36565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038416815260406020820152600061053e604083018486610c7b565b60208152600061027a602083018486610c7b56fe60c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b060003960008181609c015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e14610046578063370c826b1461009757806357de26a4146100cc575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6100d46100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6040517fa5fc076f0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a5fc076f906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212204c00c55f37d9d93afc24a97a86b86c67275c3e6f0288edd31c678400d06b4dcc64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160f5015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a257806357de26a4146100c9578063dcf8da92146100f0575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100d1610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6101177f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b6040517f32be8f0b0000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906332be8f0b906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220165f090121acbfb6f16face0e037df12b601e08d2e0fd3fd3f5e021e053308ce64736f6c6343000811003360e060405234801561001057600080fd5b5060405161035d38038061035d83398101604081905261002f91610068565b6001600160a01b0392831660805260a0919091521660c0526100a4565b80516001600160a01b038116811461006357600080fd5b919050565b60008060006060848603121561007d57600080fd5b6100868461004c565b92506020840151915061009b6040850161004c565b90509250925092565b60805160a05160c05161027f6100de6000396000605601526000818160ce015261014d01526000818160a7015261018d015261027f6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630e15999d146100515780632d6a744e146100a2578063370c826b146100c957806357de26a4146100fe575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6100f07f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610099565b610106610125565b60408051601b9390930b835263ffffffff909116602083015201610099565b6040517fcfaf49710000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063cfaf4971906024016040805180830381865afa1580156101d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f79190610200565b90939092509050565b6000806040838503121561021357600080fd5b825180601b0b811461022457600080fd5b602084015190925063ffffffff8116811461023e57600080fd5b80915050925092905056fea2646970667358221220491c4b81100c410951a4eacc896ef33bf2f2865d87768147c4ca7217d63d79c864736f6c6343000811003360c060405234801561001057600080fd5b506040516102fd3803806102fd83398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a05161024d6100b06000396000818160c3015261011b015260008181604b015261015b015261024d6000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d6a744e1461004657806357de26a414610097578063dcf8da92146100be575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61009f6100f3565b60408051601b9390930b835263ffffffff90911660208301520161008e565b6100e57f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161008e565b6040517fb62408a30000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b62408a3906024016040805180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906101ce565b90939092509050565b600080604083850312156101e157600080fd5b825180601b0b81146101f257600080fd5b602084015190925063ffffffff8116811461020c57600080fd5b80915050925092905056fea26469706673582212201d061d50f160b049953a990ae61794869544bc65e5a0d25812e444c431cb90f964736f6c63430008110033a2646970667358221220c65d86e8fe1882ee9717fe8fadf286e2319482a7213942b09ed85c68e3cb244164736f6c63430008110033", + "devdoc": { + "details": "The proxies are deployed normally and not cloned to minimize the gas cost overhead while using them to read data feed values", + "kind": "dev", + "methods": { + "computeDapiProxyAddress(bytes32,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDapiProxyWithOevAddress(bytes32,address,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDataFeedProxyAddress(bytes32,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "computeDataFeedProxyWithOevAddress(bytes32,address,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "constructor": { + "params": { + "_api3ServerV1": "Api3ServerV1 address" + } + }, + "deployDapiProxy(bytes32,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "params": { + "dapiName": "dAPI name", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDataFeedProxy(bytes32,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy" + }, + "returns": { + "proxyAddress": "Proxy address" + } + }, + "deployDataFeedProxyWithOev(bytes32,address,bytes)": { + "params": { + "dataFeedId": "Data feed ID", + "metadata": "Metadata associated with the proxy", + "oevBeneficiary": "OEV beneficiary" + }, + "returns": { + "proxyAddress": "Proxy address" + } + } + }, + "title": "Contract factory that deterministically deploys proxies that read data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV support", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "api3ServerV1()": { + "notice": "Api3ServerV1 address" + }, + "computeDapiProxyAddress(bytes32,bytes)": { + "notice": "Computes the address of the dAPI proxy" + }, + "computeDapiProxyWithOevAddress(bytes32,address,bytes)": { + "notice": "Computes the address of the dAPI proxy with OEV support" + }, + "computeDataFeedProxyAddress(bytes32,bytes)": { + "notice": "Computes the address of the data feed proxy" + }, + "computeDataFeedProxyWithOevAddress(bytes32,address,bytes)": { + "notice": "Computes the address of the data feed proxy with OEV support" + }, + "deployDapiProxy(bytes32,bytes)": { + "notice": "Deterministically deploys a dAPI proxy" + }, + "deployDapiProxyWithOev(bytes32,address,bytes)": { + "notice": "Deterministically deploys a dAPI proxy with OEV support" + }, + "deployDataFeedProxy(bytes32,bytes)": { + "notice": "Deterministically deploys a data feed proxy" + }, + "deployDataFeedProxyWithOev(bytes32,address,bytes)": { + "notice": "Deterministically deploys a data feed proxy with OEV support" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/blast/solcInputs/16343b63dc5abcc6d4d0ea75eb689f42.json b/deployments/blast/solcInputs/16343b63dc5abcc6d4d0ea75eb689f42.json new file mode 100644 index 00000000..62c7ad19 --- /dev/null +++ b/deployments/blast/solcInputs/16343b63dc5abcc6d4d0ea75eb689f42.json @@ -0,0 +1,330 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant\n * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such\n * that `ownerOf(tokenId)` is `a`.\n */\n // solhint-disable-next-line func-name-mixedcase\n function __unsafe_increaseBalance(address account, uint256 amount) internal {\n _balances[account] += amount;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Create2.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(\n uint256 amount,\n bytes32 salt,\n bytes memory bytecode\n ) internal returns (address addr) {\n require(address(this).balance >= amount, \"Create2: insufficient balance\");\n require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), \"Create2: Failed on deploy\");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n */\n function computeAddress(\n bytes32 salt,\n bytes32 bytecodeHash,\n address deployer\n ) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n require(value <= type(uint248).max, \"SafeCast: value doesn't fit in 248 bits\");\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n require(value <= type(uint240).max, \"SafeCast: value doesn't fit in 240 bits\");\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n require(value <= type(uint232).max, \"SafeCast: value doesn't fit in 232 bits\");\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.2._\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n require(value <= type(uint216).max, \"SafeCast: value doesn't fit in 216 bits\");\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n require(value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n require(value <= type(uint200).max, \"SafeCast: value doesn't fit in 200 bits\");\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n require(value <= type(uint192).max, \"SafeCast: value doesn't fit in 192 bits\");\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n require(value <= type(uint184).max, \"SafeCast: value doesn't fit in 184 bits\");\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n require(value <= type(uint176).max, \"SafeCast: value doesn't fit in 176 bits\");\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n require(value <= type(uint168).max, \"SafeCast: value doesn't fit in 168 bits\");\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n require(value <= type(uint160).max, \"SafeCast: value doesn't fit in 160 bits\");\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n require(value <= type(uint152).max, \"SafeCast: value doesn't fit in 152 bits\");\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n require(value <= type(uint144).max, \"SafeCast: value doesn't fit in 144 bits\");\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n require(value <= type(uint136).max, \"SafeCast: value doesn't fit in 136 bits\");\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v2.5._\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n require(value <= type(uint120).max, \"SafeCast: value doesn't fit in 120 bits\");\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n require(value <= type(uint112).max, \"SafeCast: value doesn't fit in 112 bits\");\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n require(value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.2._\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n require(value <= type(uint88).max, \"SafeCast: value doesn't fit in 88 bits\");\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n require(value <= type(uint80).max, \"SafeCast: value doesn't fit in 80 bits\");\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n require(value <= type(uint72).max, \"SafeCast: value doesn't fit in 72 bits\");\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v2.5._\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n require(value <= type(uint56).max, \"SafeCast: value doesn't fit in 56 bits\");\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n require(value <= type(uint48).max, \"SafeCast: value doesn't fit in 48 bits\");\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n require(value <= type(uint40).max, \"SafeCast: value doesn't fit in 40 bits\");\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v2.5._\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n require(value <= type(uint24).max, \"SafeCast: value doesn't fit in 24 bits\");\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v2.5._\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v2.5._\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n *\n * _Available since v3.0._\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n *\n * _Available since v4.7._\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n *\n * _Available since v4.7._\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n *\n * _Available since v4.7._\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n *\n * _Available since v4.7._\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n *\n * _Available since v4.7._\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n *\n * _Available since v4.7._\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n *\n * _Available since v4.7._\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n *\n * _Available since v4.7._\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n *\n * _Available since v4.7._\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n *\n * _Available since v4.7._\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n *\n * _Available since v4.7._\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n *\n * _Available since v4.7._\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n *\n * _Available since v4.7._\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n *\n * _Available since v4.7._\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n *\n * _Available since v4.7._\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n *\n * _Available since v4.7._\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n *\n * _Available since v4.7._\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n *\n * _Available since v4.7._\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n *\n * _Available since v4.7._\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n *\n * _Available since v4.7._\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n *\n * _Available since v4.7._\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n *\n * _Available since v4.7._\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n *\n * _Available since v4.7._\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n *\n * _Available since v4.7._\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n *\n * _Available since v4.7._\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n *\n * _Available since v4.7._\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n *\n * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n *\n * _Available since v3.0._\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "contracts/access-control-registry/AccessControlRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport \"../utils/SelfMulticall.sol\";\nimport \"./RoleDeriver.sol\";\nimport \"./interfaces/IAccessControlRegistry.sol\";\n\n/// @title Contract that allows users to manage independent, tree-shaped access\n/// control tables\n/// @notice Multiple contracts can refer to this contract to check if their\n/// users have granted accounts specific roles. Therefore, it aims to keep all\n/// access control roles of its users in this single contract.\n/// @dev Each user is called a \"manager\", and is the only member of their root\n/// role. Starting from this root role, they can create an arbitrary tree of\n/// roles and grant these to accounts. Each role has a description, and roles\n/// adminned by the same role cannot have the same description.\ncontract AccessControlRegistry is\n AccessControl,\n SelfMulticall,\n RoleDeriver,\n IAccessControlRegistry\n{\n /// @notice Initializes the manager by initializing its root role and\n /// granting it to them\n /// @dev Anyone can initialize a manager. An uninitialized manager\n /// attempting to initialize a role will be initialized automatically.\n /// Once a manager is initialized, subsequent initializations have no\n /// effect.\n /// @param manager Manager address to be initialized\n function initializeManager(address manager) public override {\n require(manager != address(0), \"Manager address zero\");\n bytes32 rootRole = _deriveRootRole(manager);\n if (!hasRole(rootRole, manager)) {\n _grantRole(rootRole, manager);\n emit InitializedManager(rootRole, manager, _msgSender());\n }\n }\n\n /// @notice Called by the account to renounce the role\n /// @dev Overriden to disallow managers from renouncing their root roles.\n /// `role` and `account` are not validated because\n /// `AccessControl.renounceRole` will revert if either of them is zero.\n /// @param role Role to be renounced\n /// @param account Account to renounce the role\n function renounceRole(\n bytes32 role,\n address account\n ) public override(AccessControl, IAccessControl) {\n require(\n role != _deriveRootRole(account),\n \"role is root role of account\"\n );\n AccessControl.renounceRole(role, account);\n }\n\n /// @notice Initializes a role by setting its admin role and grants it to\n /// the sender\n /// @dev If the sender should not have the initialized role, they should\n /// explicitly renounce it after initializing it.\n /// Once a role is initialized, subsequent initializations have no effect\n /// other than granting the role to the sender.\n /// The sender must be a member of `adminRole`. `adminRole` value is not\n /// validated because the sender cannot have the `bytes32(0)` role.\n /// If the sender is an uninitialized manager that is initializing a role\n /// directly under their root role, manager initialization will happen\n /// automatically, which will grant the sender `adminRole` and allow them\n /// to initialize the role.\n /// @param adminRole Admin role to be assigned to the initialized role\n /// @param description Human-readable description of the initialized role\n /// @return role Initialized role\n function initializeRoleAndGrantToSender(\n bytes32 adminRole,\n string calldata description\n ) external override returns (bytes32 role) {\n require(bytes(description).length > 0, \"Role description empty\");\n role = _deriveRole(adminRole, description);\n // AccessControl roles have `DEFAULT_ADMIN_ROLE` (i.e., `bytes32(0)`)\n // as their `adminRole` by default. No account in AccessControlRegistry\n // can possibly have that role, which means all initialized roles will\n // have non-default admin roles, and vice versa.\n if (getRoleAdmin(role) == DEFAULT_ADMIN_ROLE) {\n if (adminRole == _deriveRootRole(_msgSender())) {\n initializeManager(_msgSender());\n }\n _setRoleAdmin(role, adminRole);\n emit InitializedRole(role, adminRole, description, _msgSender());\n }\n grantRole(role, _msgSender());\n }\n}\n" + }, + "contracts/access-control-registry/AccessControlRegistryAdminned.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../utils/SelfMulticall.sol\";\nimport \"./RoleDeriver.sol\";\nimport \"./interfaces/IAccessControlRegistryAdminned.sol\";\nimport \"./interfaces/IAccessControlRegistry.sol\";\n\n/// @title Contract to be inherited by contracts whose adminship functionality\n/// will be implemented using AccessControlRegistry\ncontract AccessControlRegistryAdminned is\n SelfMulticall,\n RoleDeriver,\n IAccessControlRegistryAdminned\n{\n /// @notice AccessControlRegistry contract address\n address public immutable override accessControlRegistry;\n\n /// @notice Admin role description\n string public override adminRoleDescription;\n\n bytes32 internal immutable adminRoleDescriptionHash;\n\n /// @dev Contracts deployed with the same admin role descriptions will have\n /// the same roles, meaning that granting an account a role will authorize\n /// it in multiple contracts. Unless you want your deployed contract to\n /// share the role configuration of another contract, use a unique admin\n /// role description.\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription\n ) {\n require(_accessControlRegistry != address(0), \"ACR address zero\");\n require(\n bytes(_adminRoleDescription).length > 0,\n \"Admin role description empty\"\n );\n accessControlRegistry = _accessControlRegistry;\n adminRoleDescription = _adminRoleDescription;\n adminRoleDescriptionHash = keccak256(\n abi.encodePacked(_adminRoleDescription)\n );\n }\n\n /// @notice Derives the admin role for the specific manager address\n /// @param manager Manager address\n /// @return adminRole Admin role\n function _deriveAdminRole(\n address manager\n ) internal view returns (bytes32 adminRole) {\n adminRole = _deriveRole(\n _deriveRootRole(manager),\n adminRoleDescriptionHash\n );\n }\n}\n" + }, + "contracts/access-control-registry/AccessControlRegistryAdminnedWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./AccessControlRegistryAdminned.sol\";\nimport \"./interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\n\n/// @title Contract to be inherited by contracts with manager whose adminship\n/// functionality will be implemented using AccessControlRegistry\n/// @notice The manager address here is expected to belong to an\n/// AccessControlRegistry user that is a multisig/DAO\ncontract AccessControlRegistryAdminnedWithManager is\n AccessControlRegistryAdminned,\n IAccessControlRegistryAdminnedWithManager\n{\n /// @notice Address of the manager that manages the related\n /// AccessControlRegistry roles\n /// @dev The mutability of the manager role can be implemented by\n /// designating an OwnableCallForwarder contract as the manager. The\n /// ownership of this contract can then be transferred, effectively\n /// transferring managership.\n address public immutable override manager;\n\n /// @notice Admin role\n /// @dev Since `manager` is immutable, so is `adminRole`\n bytes32 public immutable override adminRole;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminned(\n _accessControlRegistry,\n _adminRoleDescription\n )\n {\n require(_manager != address(0), \"Manager address zero\");\n manager = _manager;\n adminRole = _deriveAdminRole(_manager);\n }\n}\n" + }, + "contracts/access-control-registry/interfaces/IAccessControlRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\nimport \"../../utils/interfaces/ISelfMulticall.sol\";\n\ninterface IAccessControlRegistry is IAccessControl, ISelfMulticall {\n event InitializedManager(\n bytes32 indexed rootRole,\n address indexed manager,\n address sender\n );\n\n event InitializedRole(\n bytes32 indexed role,\n bytes32 indexed adminRole,\n string description,\n address sender\n );\n\n function initializeManager(address manager) external;\n\n function initializeRoleAndGrantToSender(\n bytes32 adminRole,\n string calldata description\n ) external returns (bytes32 role);\n}\n" + }, + "contracts/access-control-registry/interfaces/IAccessControlRegistryAdminned.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../utils/interfaces/ISelfMulticall.sol\";\n\ninterface IAccessControlRegistryAdminned is ISelfMulticall {\n function accessControlRegistry() external view returns (address);\n\n function adminRoleDescription() external view returns (string memory);\n}\n" + }, + "contracts/access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IAccessControlRegistryAdminned.sol\";\n\ninterface IAccessControlRegistryAdminnedWithManager is\n IAccessControlRegistryAdminned\n{\n function manager() external view returns (address);\n\n function adminRole() external view returns (bytes32);\n}\n" + }, + "contracts/access-control-registry/RoleDeriver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will derive\n/// AccessControlRegistry roles\n/// @notice If a contract interfaces with AccessControlRegistry and needs to\n/// derive roles, it should inherit this contract instead of re-implementing\n/// the logic\ncontract RoleDeriver {\n /// @notice Derives the root role of the manager\n /// @param manager Manager address\n /// @return rootRole Root role\n function _deriveRootRole(\n address manager\n ) internal pure returns (bytes32 rootRole) {\n rootRole = keccak256(abi.encodePacked(manager));\n }\n\n /// @notice Derives the role using its admin role and description\n /// @dev This implies that roles adminned by the same role cannot have the\n /// same description\n /// @param adminRole Admin role\n /// @param description Human-readable description of the role\n /// @return role Role\n function _deriveRole(\n bytes32 adminRole,\n string memory description\n ) internal pure returns (bytes32 role) {\n role = _deriveRole(adminRole, keccak256(abi.encodePacked(description)));\n }\n\n /// @notice Derives the role using its admin role and description hash\n /// @dev This implies that roles adminned by the same role cannot have the\n /// same description\n /// @param adminRole Admin role\n /// @param descriptionHash Hash of the human-readable description of the\n /// role\n /// @return role Role\n function _deriveRole(\n bytes32 adminRole,\n bytes32 descriptionHash\n ) internal pure returns (bytes32 role) {\n role = keccak256(abi.encodePacked(adminRole, descriptionHash));\n }\n}\n" + }, + "contracts/allocators/Allocator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IAllocator.sol\";\n\n/// @title Abstract contract that temporarily allocates subscription slots for\n/// Airnodes\n/// @dev Airnodes that support PSP can be configured to periodically call\n/// multiple Allocators to fetch information about multiple slots from each.\n/// The Airnode must not serve expired slots or subscriptions with invalid IDs.\n/// The Airnode operator is expected to communicate the required information to\n/// the users through off-chain channels.\nabstract contract Allocator is IAllocator {\n struct Slot {\n bytes32 subscriptionId;\n address setter;\n uint32 expirationTimestamp;\n }\n\n /// @notice Slot setter role description\n string public constant override SLOT_SETTER_ROLE_DESCRIPTION =\n \"Slot setter\";\n\n /// @notice Subscription slot of an Airnode addressed by the index\n mapping(address => mapping(uint256 => Slot))\n public\n override airnodeToSlotIndexToSlot;\n\n /// @notice Resets the slot\n /// @dev This will revert if the slot has been set before, and the sender\n /// is not the setter of the slot, and the slot has not expired and the\n /// setter of the slot is still authorized to set slots.\n /// The sender does not have to be authorized to set slots to use this.\n /// @param airnode Airnode address\n /// @param slotIndex Index of the subscription slot to be set\n function resetSlot(address airnode, uint256 slotIndex) external override {\n if (\n airnodeToSlotIndexToSlot[airnode][slotIndex].subscriptionId !=\n bytes32(0)\n ) {\n _resetSlot(airnode, slotIndex);\n emit ResetSlot(airnode, slotIndex, msg.sender);\n }\n }\n\n function slotCanBeResetByAccount(\n address airnode,\n uint256 slotIndex,\n address account\n ) public view virtual override returns (bool);\n\n /// @notice Called internally to set the slot with the given parameters\n /// @dev The set slot can be reset by its setter, or when it has expired,\n /// or when its setter is no longer authorized to set slots\n /// @param airnode Airnode address\n /// @param slotIndex Index of the subscription slot to be set\n /// @param subscriptionId Subscription ID\n /// @param expirationTimestamp Timestamp at which the slot allocation will\n /// expire\n function _setSlot(\n address airnode,\n uint256 slotIndex,\n bytes32 subscriptionId,\n uint32 expirationTimestamp\n ) internal {\n require(\n expirationTimestamp > block.timestamp,\n \"Expiration not in future\"\n );\n _resetSlot(airnode, slotIndex);\n airnodeToSlotIndexToSlot[airnode][slotIndex] = Slot({\n subscriptionId: subscriptionId,\n setter: msg.sender,\n expirationTimestamp: expirationTimestamp\n });\n emit SetSlot(\n airnode,\n slotIndex,\n subscriptionId,\n expirationTimestamp,\n msg.sender\n );\n }\n\n /// @notice Called privately to reset a slot\n /// @param airnode Airnode address\n /// @param slotIndex Index of the subscription slot to be reset\n function _resetSlot(address airnode, uint256 slotIndex) private {\n require(\n slotCanBeResetByAccount(airnode, slotIndex, msg.sender),\n \"Cannot reset slot\"\n );\n delete airnodeToSlotIndexToSlot[airnode][slotIndex];\n }\n}\n" + }, + "contracts/allocators/AllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminned.sol\";\nimport \"./Allocator.sol\";\nimport \"./interfaces/IAllocatorWithAirnode.sol\";\n\n/// @title Contract that Airnode operators can use to temporarily\n/// allocate subscription slots for the respective Airnodes\ncontract AllocatorWithAirnode is\n AccessControlRegistryAdminned,\n Allocator,\n IAllocatorWithAirnode\n{\n bytes32 private constant SLOT_SETTER_ROLE_DESCRIPTION_HASH =\n keccak256(abi.encodePacked(SLOT_SETTER_ROLE_DESCRIPTION));\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription\n )\n AccessControlRegistryAdminned(\n _accessControlRegistry,\n _adminRoleDescription\n )\n {}\n\n /// @notice Sets a slot with the given parameters\n /// @param airnode Airnode address\n /// @param slotIndex Index of the subscription slot to be set\n /// @param subscriptionId Subscription ID\n /// @param expirationTimestamp Timestamp at which the slot allocation will\n /// expire\n function setSlot(\n address airnode,\n uint256 slotIndex,\n bytes32 subscriptionId,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasSlotSetterRoleOrIsAirnode(airnode, msg.sender),\n \"Sender cannot set slot\"\n );\n _setSlot(airnode, slotIndex, subscriptionId, expirationTimestamp);\n }\n\n /// @notice Returns if the account has the slot setter role or has the\n /// respective Airnode address\n /// @param airnode Airnode address\n /// @param account Account address\n function hasSlotSetterRoleOrIsAirnode(\n address airnode,\n address account\n ) public view override returns (bool) {\n return\n airnode == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveSlotSetterRole(airnode),\n account\n );\n }\n\n /// @notice Derives the admin role for the specific Airnode address\n /// @param airnode Airnode address\n /// @return adminRole Admin role\n function deriveAdminRole(\n address airnode\n ) public view override returns (bytes32 adminRole) {\n adminRole = _deriveAdminRole(airnode);\n }\n\n /// @notice Derives the slot setter role for the specific Airnode address\n /// @param airnode Airnode address\n /// @return slotSetterRole Slot setter role\n function deriveSlotSetterRole(\n address airnode\n ) public view override returns (bytes32 slotSetterRole) {\n slotSetterRole = _deriveRole(\n _deriveAdminRole(airnode),\n SLOT_SETTER_ROLE_DESCRIPTION_HASH\n );\n }\n\n function slotCanBeResetByAccount(\n address airnode,\n uint256 slotIndex,\n address account\n ) public view override(IAllocator, Allocator) returns (bool) {\n Slot storage slot = airnodeToSlotIndexToSlot[airnode][slotIndex];\n return\n slot.setter == account ||\n slot.expirationTimestamp <= block.timestamp ||\n !hasSlotSetterRoleOrIsAirnode(\n airnode,\n airnodeToSlotIndexToSlot[airnode][slotIndex].setter\n );\n }\n}\n" + }, + "contracts/allocators/AllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./Allocator.sol\";\nimport \"./interfaces/IAllocatorWithManager.sol\";\n\n/// @title Contract that Airnode operators can use to temporarily\n/// allocate subscription slots for Airnodes\ncontract AllocatorWithManager is\n AccessControlRegistryAdminnedWithManager,\n Allocator,\n IAllocatorWithManager\n{\n /// @notice Slot setter role\n bytes32 public immutable override slotSetterRole;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n slotSetterRole = _deriveRole(\n adminRole,\n keccak256(abi.encodePacked(SLOT_SETTER_ROLE_DESCRIPTION))\n );\n }\n\n /// @notice Sets a slot with the given parameters\n /// @param airnode Airnode address\n /// @param slotIndex Index of the subscription slot to be set\n /// @param subscriptionId Subscription ID\n /// @param expirationTimestamp Timestamp at which the slot allocation will\n /// expire\n function setSlot(\n address airnode,\n uint256 slotIndex,\n bytes32 subscriptionId,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasSlotSetterRoleOrIsManager(msg.sender),\n \"Sender cannot set slot\"\n );\n _setSlot(airnode, slotIndex, subscriptionId, expirationTimestamp);\n }\n\n /// @notice Returns if the account has the slot setter role or is the\n /// manager\n /// @param account Account address\n function hasSlotSetterRoleOrIsManager(\n address account\n ) public view override returns (bool) {\n return\n manager == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n slotSetterRole,\n account\n );\n }\n\n function slotCanBeResetByAccount(\n address airnode,\n uint256 slotIndex,\n address account\n ) public view override(IAllocator, Allocator) returns (bool) {\n Slot storage slot = airnodeToSlotIndexToSlot[airnode][slotIndex];\n return\n slot.setter == account ||\n slot.expirationTimestamp <= block.timestamp ||\n !hasSlotSetterRoleOrIsManager(\n airnodeToSlotIndexToSlot[airnode][slotIndex].setter\n );\n }\n}\n" + }, + "contracts/allocators/interfaces/IAllocator.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IAllocator {\n event SetSlot(\n address indexed airnode,\n uint256 indexed slotIndex,\n bytes32 subscriptionId,\n uint32 expirationTimestamp,\n address sender\n );\n\n event ResetSlot(\n address indexed airnode,\n uint256 indexed slotIndex,\n address sender\n );\n\n function setSlot(\n address airnode,\n uint256 slotIndex,\n bytes32 subscriptionId,\n uint32 expirationTimestamp\n ) external;\n\n function resetSlot(address airnode, uint256 slotIndex) external;\n\n function slotCanBeResetByAccount(\n address airnode,\n uint256 slotIndex,\n address account\n ) external view returns (bool);\n\n // solhint-disable-next-line func-name-mixedcase\n function SLOT_SETTER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function airnodeToSlotIndexToSlot(\n address airnode,\n uint256 slotIndex\n )\n external\n view\n returns (\n bytes32 subscriptionId,\n address setter,\n uint32 expirationTimestamp\n );\n}\n" + }, + "contracts/allocators/interfaces/IAllocatorWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\";\nimport \"./IAllocator.sol\";\n\ninterface IAllocatorWithAirnode is IAccessControlRegistryAdminned, IAllocator {\n function hasSlotSetterRoleOrIsAirnode(\n address airnode,\n address account\n ) external view returns (bool);\n\n function deriveAdminRole(\n address airnode\n ) external view returns (bytes32 adminRole);\n\n function deriveSlotSetterRole(\n address airnode\n ) external view returns (bytes32 slotSetterRole);\n}\n" + }, + "contracts/allocators/interfaces/IAllocatorWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\nimport \"./IAllocator.sol\";\n\ninterface IAllocatorWithManager is\n IAccessControlRegistryAdminnedWithManager,\n IAllocator\n{\n function hasSlotSetterRoleOrIsManager(\n address account\n ) external view returns (bool);\n\n function slotSetterRole() external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/aggregation/Median.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Sort.sol\";\nimport \"./QuickSelect.sol\";\n\n/// @title Contract to be inherited by contracts that will calculate the median\n/// of an array\n/// @notice The operation will be in-place, i.e., the array provided as the\n/// argument will be modified.\ncontract Median is Sort, Quickselect {\n /// @notice Returns the median of the array\n /// @dev Uses an unrolled sorting implementation for shorter arrays and\n /// quickselect for longer arrays for gas cost efficiency\n /// @param array Array whose median is to be calculated\n /// @return Median of the array\n function median(int256[] memory array) internal pure returns (int256) {\n uint256 arrayLength = array.length;\n if (arrayLength <= MAX_SORT_LENGTH) {\n sort(array);\n if (arrayLength % 2 == 1) {\n return array[arrayLength / 2];\n } else {\n assert(arrayLength != 0);\n unchecked {\n return\n average(\n array[arrayLength / 2 - 1],\n array[arrayLength / 2]\n );\n }\n }\n } else {\n if (arrayLength % 2 == 1) {\n return array[quickselectK(array, arrayLength / 2)];\n } else {\n uint256 mid1;\n uint256 mid2;\n unchecked {\n (mid1, mid2) = quickselectKPlusOne(\n array,\n arrayLength / 2 - 1\n );\n }\n return average(array[mid1], array[mid2]);\n }\n }\n }\n\n /// @notice Averages two signed integers without overflowing\n /// @param x Integer x\n /// @param y Integer y\n /// @return Average of integers x and y\n function average(int256 x, int256 y) private pure returns (int256) {\n unchecked {\n int256 averageRoundedDownToNegativeInfinity = (x >> 1) +\n (y >> 1) +\n (x & y & 1);\n // If the average rounded down to negative infinity is negative\n // (i.e., its 256th sign bit is set), and one of (x, y) is even and\n // the other one is odd (i.e., the 1st bit of their xor is set),\n // add 1 to round the average down to zero instead.\n // We will typecast the signed integer to unsigned to logical-shift\n // int256(uint256(signedInt)) >> 255 ~= signedInt >>> 255\n return\n averageRoundedDownToNegativeInfinity +\n (int256(\n (uint256(averageRoundedDownToNegativeInfinity) >> 255)\n ) & (x ^ y));\n }\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/mock/MockMedian.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../Median.sol\";\n\ncontract MockMedian is Median {\n function exposedMedian(\n int256[] memory array\n ) external pure returns (int256) {\n return median(array);\n }\n\n function exposedAverage(int256 x, int256 y) external pure returns (int256) {\n int256[] memory array = new int256[](2);\n if (x < y) {\n array[0] = x;\n array[1] = y;\n } else {\n array[0] = y;\n array[1] = x;\n }\n return median(array);\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/mock/MockSort.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../Median.sol\";\n\ncontract MockSort is Sort {\n function exposedSort(\n int256[] memory array\n ) external pure returns (int256[] memory) {\n sort(array);\n return array;\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/QuickSelect.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will calculate the index\n/// of the k-th and optionally (k+1)-th largest elements in the array\n/// @notice Uses quickselect, which operates in-place, i.e., the array provided\n/// as the argument will be modified.\ncontract Quickselect {\n /// @notice Returns the index of the k-th largest element in the array\n /// @param array Array in which k-th largest element will be searched\n /// @param k K\n /// @return indK Index of the k-th largest element\n function quickselectK(\n int256[] memory array,\n uint256 k\n ) internal pure returns (uint256 indK) {\n uint256 arrayLength = array.length;\n assert(arrayLength > 0);\n unchecked {\n (indK, ) = quickselect(array, 0, arrayLength - 1, k, false);\n }\n }\n\n /// @notice Returns the index of the k-th and (k+1)-th largest elements in\n /// the array\n /// @param array Array in which k-th and (k+1)-th largest elements will be\n /// searched\n /// @param k K\n /// @return indK Index of the k-th largest element\n /// @return indKPlusOne Index of the (k+1)-th largest element\n function quickselectKPlusOne(\n int256[] memory array,\n uint256 k\n ) internal pure returns (uint256 indK, uint256 indKPlusOne) {\n uint256 arrayLength = array.length;\n assert(arrayLength > 1);\n unchecked {\n (indK, indKPlusOne) = quickselect(\n array,\n 0,\n arrayLength - 1,\n k,\n true\n );\n }\n }\n\n /// @notice Returns the index of the k-th largest element in the specified\n /// section of the (potentially unsorted) array\n /// @param array Array in which K will be searched for\n /// @param lo Starting index of the section of the array that K will be\n /// searched in\n /// @param hi Last index of the section of the array that K will be\n /// searched in\n /// @param k K\n /// @param selectKPlusOne If the index of the (k+1)-th largest element is\n /// to be returned\n /// @return indK Index of the k-th largest element\n /// @return indKPlusOne Index of the (k+1)-th largest element (only set if\n /// `selectKPlusOne` is `true`)\n function quickselect(\n int256[] memory array,\n uint256 lo,\n uint256 hi,\n uint256 k,\n bool selectKPlusOne\n ) private pure returns (uint256 indK, uint256 indKPlusOne) {\n if (lo == hi) {\n return (k, 0);\n }\n uint256 indPivot = partition(array, lo, hi);\n if (k < indPivot) {\n unchecked {\n (indK, ) = quickselect(array, lo, indPivot - 1, k, false);\n }\n } else if (k > indPivot) {\n unchecked {\n (indK, ) = quickselect(array, indPivot + 1, hi, k, false);\n }\n } else {\n indK = indPivot;\n }\n // Since Quickselect ends in the array being partitioned around the\n // k-th largest element, we can continue searching towards right for\n // the (k+1)-th largest element, which is useful in calculating the\n // median of an array with even length\n if (selectKPlusOne) {\n unchecked {\n indKPlusOne = indK + 1;\n }\n uint256 i;\n unchecked {\n i = indKPlusOne + 1;\n }\n uint256 arrayLength = array.length;\n for (; i < arrayLength; ) {\n if (array[i] < array[indKPlusOne]) {\n indKPlusOne = i;\n }\n unchecked {\n i++;\n }\n }\n }\n }\n\n /// @notice Partitions the array into two around a pivot\n /// @param array Array that will be partitioned\n /// @param lo Starting index of the section of the array that will be\n /// partitioned\n /// @param hi Last index of the section of the array that will be\n /// partitioned\n /// @return pivotInd Pivot index\n function partition(\n int256[] memory array,\n uint256 lo,\n uint256 hi\n ) private pure returns (uint256 pivotInd) {\n if (lo == hi) {\n return lo;\n }\n int256 pivot = array[lo];\n uint256 i = lo;\n unchecked {\n pivotInd = hi + 1;\n }\n while (true) {\n do {\n unchecked {\n i++;\n }\n } while (i < array.length && array[i] < pivot);\n do {\n unchecked {\n pivotInd--;\n }\n } while (array[pivotInd] > pivot);\n if (i >= pivotInd) {\n (array[lo], array[pivotInd]) = (array[pivotInd], array[lo]);\n return pivotInd;\n }\n (array[i], array[pivotInd]) = (array[pivotInd], array[i]);\n }\n }\n}\n" + }, + "contracts/api3-server-v1/aggregation/Sort.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @title Contract to be inherited by contracts that will sort an array using\n/// an unrolled implementation\n/// @notice The operation will be in-place, i.e., the array provided as the\n/// argument will be modified.\ncontract Sort {\n uint256 internal constant MAX_SORT_LENGTH = 9;\n\n /// @notice Sorts the array\n /// @param array Array to be sorted\n function sort(int256[] memory array) internal pure {\n uint256 arrayLength = array.length;\n require(arrayLength <= MAX_SORT_LENGTH, \"Array too long to sort\");\n // Do a binary search\n if (arrayLength < 6) {\n // Possible lengths: 1, 2, 3, 4, 5\n if (arrayLength < 4) {\n // Possible lengths: 1, 2, 3\n if (arrayLength == 3) {\n // Length: 3\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 0, 1);\n } else if (arrayLength == 2) {\n // Length: 2\n swapIfFirstIsLarger(array, 0, 1);\n }\n // Do nothing for Length: 1\n } else {\n // Possible lengths: 4, 5\n if (arrayLength == 5) {\n // Length: 5\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 1, 2);\n } else {\n // Length: 4\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 1, 2);\n }\n }\n } else {\n // Possible lengths: 6, 7, 8, 9\n if (arrayLength < 8) {\n // Possible lengths: 6, 7\n if (arrayLength == 7) {\n // Length: 7\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 4, 6);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 2, 6);\n swapIfFirstIsLarger(array, 1, 5);\n swapIfFirstIsLarger(array, 0, 4);\n swapIfFirstIsLarger(array, 2, 5);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n } else {\n // Length: 6\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 2, 3);\n }\n } else {\n // Possible lengths: 8, 9\n if (arrayLength == 9) {\n // Length: 9\n swapIfFirstIsLarger(array, 1, 8);\n swapIfFirstIsLarger(array, 2, 7);\n swapIfFirstIsLarger(array, 3, 6);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 1, 4);\n swapIfFirstIsLarger(array, 5, 8);\n swapIfFirstIsLarger(array, 0, 2);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 2, 6);\n swapIfFirstIsLarger(array, 7, 8);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 3);\n swapIfFirstIsLarger(array, 5, 7);\n swapIfFirstIsLarger(array, 4, 6);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 7, 8);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n } else {\n // Length: 8\n swapIfFirstIsLarger(array, 0, 7);\n swapIfFirstIsLarger(array, 1, 6);\n swapIfFirstIsLarger(array, 2, 5);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 0, 3);\n swapIfFirstIsLarger(array, 4, 7);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 0, 1);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 6, 7);\n swapIfFirstIsLarger(array, 3, 5);\n swapIfFirstIsLarger(array, 2, 4);\n swapIfFirstIsLarger(array, 1, 2);\n swapIfFirstIsLarger(array, 3, 4);\n swapIfFirstIsLarger(array, 5, 6);\n swapIfFirstIsLarger(array, 2, 3);\n swapIfFirstIsLarger(array, 4, 5);\n swapIfFirstIsLarger(array, 3, 4);\n }\n }\n }\n }\n\n /// @notice Swaps two elements of an array if the first element is greater\n /// than the second\n /// @param array Array whose elements are to be swapped\n /// @param ind1 Index of the first element\n /// @param ind2 Index of the second element\n function swapIfFirstIsLarger(\n int256[] memory array,\n uint256 ind1,\n uint256 ind2\n ) private pure {\n if (array[ind1] > array[ind2]) {\n (array[ind1], array[ind2]) = (array[ind2], array[ind1]);\n }\n }\n}\n" + }, + "contracts/api3-server-v1/Api3ServerV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./OevDapiServer.sol\";\nimport \"./BeaconUpdatesWithSignedData.sol\";\nimport \"./interfaces/IApi3ServerV1.sol\";\n\n/// @title First version of the contract that API3 uses to serve data feeds\n/// @notice Api3ServerV1 serves data feeds in the form of Beacons, Beacon sets,\n/// dAPIs, with optional OEV support for all of these.\n/// The base Beacons are only updateable using signed data, and the Beacon sets\n/// are updateable based on the Beacons, optionally using PSP. OEV proxy\n/// Beacons and Beacon sets are updateable using OEV-signed data.\n/// Api3ServerV1 does not support Beacons to be updated using RRP or PSP.\ncontract Api3ServerV1 is\n OevDapiServer,\n BeaconUpdatesWithSignedData,\n IApi3ServerV1\n{\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n ) OevDapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\n\n /// @notice Reads the data feed with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithId(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithId(dataFeedId);\n }\n\n /// @notice Reads the data feed with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithDapiNameHash(dapiNameHash);\n }\n\n /// @notice Reads the data feed as the OEV proxy with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithIdAsOevProxy(dataFeedId);\n }\n\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) external view override returns (int224 value, uint32 timestamp) {\n return _readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\n }\n\n function dataFeeds(\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n\n function oevProxyToIdToDataFeed(\n address proxy,\n bytes32 dataFeedId\n ) external view override returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _oevProxyToIdToDataFeed[proxy][dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n}\n" + }, + "contracts/api3-server-v1/BeaconUpdatesWithSignedData.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IBeaconUpdatesWithSignedData.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that updates Beacons using signed data\ncontract BeaconUpdatesWithSignedData is\n DataFeedServer,\n IBeaconUpdatesWithSignedData\n{\n using ECDSA for bytes32;\n\n /// @notice Updates a Beacon using data signed by the Airnode\n /// @dev The signed data here is intentionally very general for practical\n /// reasons. It is less demanding on the signer to have data signed once\n /// and use that everywhere.\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param timestamp Signature timestamp\n /// @param data Update data (an `int256` encoded in contract ABI)\n /// @param signature Template ID, timestamp and the update data signed by\n /// the Airnode\n /// @return beaconId Updated Beacon ID\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override returns (bytes32 beaconId) {\n require(\n (\n keccak256(abi.encodePacked(templateId, timestamp, data))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n beaconId = deriveBeaconId(airnode, templateId);\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\n emit UpdatedBeaconWithSignedData(\n beaconId,\n updatedValue,\n uint32(timestamp)\n );\n }\n}\n" + }, + "contracts/api3-server-v1/DapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IDapiServer.sol\";\n\n/// @title Contract that serves dAPIs mapped to Beacons and Beacon sets\n/// @notice Beacons and Beacon sets are addressed by immutable IDs. Although\n/// this is trust-minimized, it requires users to manage the ID of the data\n/// feed they are using. For when the user does not want to do this, dAPIs can\n/// be used as an abstraction layer. By using a dAPI, the user delegates this\n/// responsibility to dAPI management. It is important for dAPI management to\n/// be restricted by consensus rules (by using a multisig or a DAO) and similar\n/// trustless security mechanisms.\ncontract DapiServer is\n AccessControlRegistryAdminnedWithManager,\n DataFeedServer,\n IDapiServer\n{\n /// @notice dAPI name setter role description\n string public constant override DAPI_NAME_SETTER_ROLE_DESCRIPTION =\n \"dAPI name setter\";\n\n /// @notice dAPI name setter role\n bytes32 public immutable override dapiNameSetterRole;\n\n /// @notice dAPI name hash mapped to the data feed ID\n mapping(bytes32 => bytes32) public override dapiNameHashToDataFeedId;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n dapiNameSetterRole = _deriveRole(\n _deriveAdminRole(manager),\n DAPI_NAME_SETTER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Sets the data feed ID the dAPI name points to\n /// @dev While a data feed ID refers to a specific Beacon or Beacon set,\n /// dAPI names provide a more abstract interface for convenience. This\n /// means a dAPI name that was pointing to a Beacon can be pointed to a\n /// Beacon set, then another Beacon set, etc.\n /// @param dapiName Human-readable dAPI name\n /// @param dataFeedId Data feed ID the dAPI name will point to\n function setDapiName(\n bytes32 dapiName,\n bytes32 dataFeedId\n ) external override {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n dapiNameSetterRole,\n msg.sender\n ),\n \"Sender cannot set dAPI name\"\n );\n dapiNameHashToDataFeedId[\n keccak256(abi.encodePacked(dapiName))\n ] = dataFeedId;\n emit SetDapiName(dataFeedId, dapiName, msg.sender);\n }\n\n /// @notice Returns the data feed ID the dAPI name is set to\n /// @param dapiName dAPI name\n /// @return Data feed ID\n function dapiNameToDataFeedId(\n bytes32 dapiName\n ) external view override returns (bytes32) {\n return dapiNameHashToDataFeedId[keccak256(abi.encodePacked(dapiName))];\n }\n\n /// @notice Reads the data feed with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) internal view returns (int224 value, uint32 timestamp) {\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\n require(dataFeedId != bytes32(0), \"dAPI name not set\");\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n require(timestamp > 0, \"Data feed not initialized\");\n }\n}\n" + }, + "contracts/api3-server-v1/DataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../utils/ExtendedSelfMulticall.sol\";\nimport \"./aggregation/Median.sol\";\nimport \"./interfaces/IDataFeedServer.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that serves Beacons and Beacon sets\n/// @notice A Beacon is a live data feed addressed by an ID, which is derived\n/// from an Airnode address and a template ID. This is suitable where the more\n/// recent data point is always more favorable, e.g., in the context of an\n/// asset price data feed. Beacons can also be seen as one-Airnode data feeds\n/// that can be used individually or combined to build Beacon sets.\ncontract DataFeedServer is ExtendedSelfMulticall, Median, IDataFeedServer {\n using ECDSA for bytes32;\n\n // Airnodes serve their fulfillment data along with timestamps. This\n // contract casts the reported data to `int224` and the timestamp to\n // `uint32`, which works until year 2106.\n struct DataFeed {\n int224 value;\n uint32 timestamp;\n }\n\n /// @notice Data feed with ID\n mapping(bytes32 => DataFeed) internal _dataFeeds;\n\n /// @dev Reverts if the timestamp is from more than 1 hour in the future\n modifier onlyValidTimestamp(uint256 timestamp) virtual {\n unchecked {\n require(\n timestamp < block.timestamp + 1 hours,\n \"Timestamp not valid\"\n );\n }\n _;\n }\n\n /// @notice Updates the Beacon set using the current values of its Beacons\n /// @dev As an oddity, this function still works if some of the IDs in\n /// `beaconIds` belong to Beacon sets rather than Beacons. This can be used\n /// to implement hierarchical Beacon sets.\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Beacon set ID\n function updateBeaconSetWithBeacons(\n bytes32[] memory beaconIds\n ) public override returns (bytes32 beaconSetId) {\n (int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(\n beaconIds\n );\n beaconSetId = deriveBeaconSetId(beaconIds);\n DataFeed storage beaconSet = _dataFeeds[beaconSetId];\n if (beaconSet.timestamp == updatedTimestamp) {\n require(\n beaconSet.value != updatedValue,\n \"Does not update Beacon set\"\n );\n }\n _dataFeeds[beaconSetId] = DataFeed({\n value: updatedValue,\n timestamp: updatedTimestamp\n });\n emit UpdatedBeaconSetWithBeacons(\n beaconSetId,\n updatedValue,\n updatedTimestamp\n );\n }\n\n /// @notice Reads the data feed with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithId(\n bytes32 dataFeedId\n ) internal view returns (int224 value, uint32 timestamp) {\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n require(timestamp > 0, \"Data feed not initialized\");\n }\n\n /// @notice Derives the Beacon ID from the Airnode address and template ID\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @return beaconId Beacon ID\n function deriveBeaconId(\n address airnode,\n bytes32 templateId\n ) internal pure returns (bytes32 beaconId) {\n beaconId = keccak256(abi.encodePacked(airnode, templateId));\n }\n\n /// @notice Derives the Beacon set ID from the Beacon IDs\n /// @dev Notice that `abi.encode()` is used over `abi.encodePacked()`\n /// @param beaconIds Beacon IDs\n /// @return beaconSetId Beacon set ID\n function deriveBeaconSetId(\n bytes32[] memory beaconIds\n ) internal pure returns (bytes32 beaconSetId) {\n beaconSetId = keccak256(abi.encode(beaconIds));\n }\n\n /// @notice Called privately to process the Beacon update\n /// @param beaconId Beacon ID\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @return updatedBeaconValue Updated Beacon value\n function processBeaconUpdate(\n bytes32 beaconId,\n uint256 timestamp,\n bytes calldata data\n )\n internal\n onlyValidTimestamp(timestamp)\n returns (int224 updatedBeaconValue)\n {\n updatedBeaconValue = decodeFulfillmentData(data);\n require(\n timestamp > _dataFeeds[beaconId].timestamp,\n \"Does not update timestamp\"\n );\n _dataFeeds[beaconId] = DataFeed({\n value: updatedBeaconValue,\n timestamp: uint32(timestamp)\n });\n }\n\n /// @notice Called privately to decode the fulfillment data\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @return decodedData Decoded fulfillment data\n function decodeFulfillmentData(\n bytes memory data\n ) internal pure returns (int224) {\n require(data.length == 32, \"Data length not correct\");\n int256 decodedData = abi.decode(data, (int256));\n require(\n decodedData >= type(int224).min && decodedData <= type(int224).max,\n \"Value typecasting error\"\n );\n return int224(decodedData);\n }\n\n /// @notice Called privately to aggregate the Beacons and return the result\n /// @param beaconIds Beacon IDs\n /// @return value Aggregation value\n /// @return timestamp Aggregation timestamp\n function aggregateBeacons(\n bytes32[] memory beaconIds\n ) internal view returns (int224 value, uint32 timestamp) {\n uint256 beaconCount = beaconIds.length;\n require(beaconCount > 1, \"Specified less than two Beacons\");\n int256[] memory values = new int256[](beaconCount);\n int256[] memory timestamps = new int256[](beaconCount);\n for (uint256 ind = 0; ind < beaconCount; ) {\n DataFeed storage dataFeed = _dataFeeds[beaconIds[ind]];\n values[ind] = dataFeed.value;\n timestamps[ind] = int256(uint256(dataFeed.timestamp));\n unchecked {\n ind++;\n }\n }\n value = int224(median(values));\n timestamp = uint32(uint256(median(timestamps)));\n }\n}\n" + }, + "contracts/api3-server-v1/extensions/BeaconSetUpdatesWithPsp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../DataFeedServer.sol\";\nimport \"./interfaces/IDataFeedUpdatesWithPsp.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that updates Beacon sets using regular and relayed PSP\n/// @dev BeaconSetUpdatesWithPsp is a PSP requester contract. Unlike RRP, which\n/// is implemented as a central contract, PSP implementation is built into the\n/// requester for optimization. Accordingly, the checks that are not required\n/// are omitted. Some examples:\n/// - PSP Beacon set update subscription IDs are not verified, as the\n/// Airnode/relayer cannot be made to \"misreport a Beacon set update\" by\n/// spoofing a subscription ID.\n/// - While executing a PSP Beacon set update, even the signature is not\n/// checked because this is a purely keeper job that does not require off-chain\n/// data. Similar to Beacon updates, any Beacon set update is welcome.\ncontract BeaconSetUpdatesWithPsp is DataFeedServer, IBeaconSetUpdatesWithPsp {\n using ECDSA for bytes32;\n\n /// @notice Number that represents 100%\n /// @dev 10^8 (and not a larger number) is chosen to avoid overflows in\n /// `calculateUpdateInPercentage()`. Since the reported data needs to fit\n /// into 224 bits, its multiplication by 10^8 is guaranteed not to\n /// overflow.\n uint256 public constant override HUNDRED_PERCENT = 1e8;\n\n /// @notice Returns if the respective Beacon set needs to be updated based\n /// on the condition parameters\n /// @dev `endpointOrTemplateId` in the respective Subscription is expected\n /// to be zero, which means the `parameters` field of the Subscription will\n /// be forwarded to this function as `data`. This field should be the\n /// Beacon ID array encoded in contract ABI.\n /// Even if this function returns `true`, the respective Subscription\n /// fulfillment will fail if will not update the Beacon set value or\n /// timestamp.\n /// @param // subscriptionId Subscription ID\n /// @param data Fulfillment data (array of Beacon IDs, i.e., `bytes32[]`\n /// encoded in contract ABI)\n /// @param conditionParameters Subscription condition parameters. This\n /// includes multiple ABI-encoded values, see `checkUpdateCondition()`.\n /// @return If the Beacon set update subscription should be fulfilled\n function conditionPspBeaconSetUpdate(\n bytes32 /* subscriptionId */,\n bytes calldata data,\n bytes calldata conditionParameters\n ) public view virtual override returns (bool) {\n bytes32[] memory beaconIds = abi.decode(data, (bytes32[]));\n require(\n keccak256(abi.encode(beaconIds)) == keccak256(data),\n \"Data length not correct\"\n );\n (int224 updatedValue, uint32 updatedTimestamp) = aggregateBeacons(\n beaconIds\n );\n return\n checkUpdateCondition(\n deriveBeaconSetId(beaconIds),\n updatedValue,\n updatedTimestamp,\n conditionParameters\n );\n }\n\n /// @notice Called by the Airnode/relayer using the sponsor wallet to\n /// fulfill the Beacon set update subscription\n /// @dev Similar to `conditionPspBeaconSetUpdate()`, if\n /// `endpointOrTemplateId` of the Subscription is zero, its `parameters`\n /// field will be forwarded to `data` here, which is expect to be contract\n /// ABI-encoded array of Beacon IDs.\n /// It does not make sense for this subscription to be relayed, as there is\n /// no external data being delivered. Nevertheless, this is allowed for the\n /// lack of a reason to prevent it.\n /// Even though the consistency of the arguments are not being checked, if\n /// a standard implementation of Airnode is being used, these can be\n /// expected to be correct. Either way, the assumption is that it does not\n /// matter for the purposes of a Beacon set update subscription.\n /// @param // subscriptionId Subscription ID\n /// @param // airnode Airnode address\n /// @param // relayer Relayer address\n /// @param // sponsor Sponsor address\n /// @param // timestamp Timestamp used in the signature\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @param // signature Subscription ID, timestamp, sponsor wallet address\n /// (and fulfillment data if the relayer is not the Airnode) signed by the\n /// Airnode wallet\n function fulfillPspBeaconSetUpdate(\n bytes32 /* subscriptionId */,\n address /* airnode */,\n address /* relayer */,\n address /* sponsor */,\n uint256 /* timestamp */,\n bytes calldata data,\n bytes calldata /* signature */\n ) external override {\n require(\n keccak256(data) ==\n updateBeaconSetWithBeacons(abi.decode(data, (bytes32[]))),\n \"Data length not correct\"\n );\n }\n\n /// @notice Called privately to check the update condition\n /// @param dataFeedId Data feed ID\n /// @param updatedValue Value the data feed will be updated with\n /// @param updatedTimestamp Timestamp the data feed will be updated with\n /// @param conditionParameters Subscription condition parameters. This\n /// includes multiple ABI-encoded values, see `checkUpdateCondition()`.\n /// @return If the update should be executed\n function checkUpdateCondition(\n bytes32 dataFeedId,\n int224 updatedValue,\n uint32 updatedTimestamp,\n bytes calldata conditionParameters\n ) internal view returns (bool) {\n require(conditionParameters.length == 96, \"Incorrect parameter length\");\n (\n uint256 deviationThresholdInPercentage,\n int224 deviationReference,\n uint256 heartbeatInterval\n ) = abi.decode(conditionParameters, (uint256, int224, uint256));\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n unchecked {\n return\n (dataFeed.timestamp == 0 && updatedTimestamp != 0) ||\n (deviationThresholdInPercentage != 0 &&\n calculateUpdateInPercentage(\n dataFeed.value,\n updatedValue,\n deviationReference\n ) >=\n deviationThresholdInPercentage) ||\n (heartbeatInterval != 0 &&\n dataFeed.timestamp + heartbeatInterval <= updatedTimestamp);\n }\n }\n\n /// @notice Called privately to calculate the update magnitude in\n /// percentages where 100% is represented as `HUNDRED_PERCENT`\n /// @dev The percentage changes will be more pronounced when the initial\n /// value is closer to the deviation reference. Therefore, while deciding\n /// on the subscription conditions, one should choose a deviation reference\n /// that will produce the desired update behavior. In general, the\n /// deviation reference should not be close to the operational range of the\n /// data feed (e.g., if the value is expected to change between -10 and 10,\n /// a deviation reference of -30 may be suitable.)\n /// @param initialValue Initial value\n /// @param updatedValue Updated value\n /// @param deviationReference Reference value that deviation will be\n /// calculated against\n /// @return updateInPercentage Update in percentage\n function calculateUpdateInPercentage(\n int224 initialValue,\n int224 updatedValue,\n int224 deviationReference\n ) private pure returns (uint256 updateInPercentage) {\n int256 delta;\n unchecked {\n delta = int256(updatedValue) - int256(initialValue);\n }\n if (delta == 0) {\n return 0;\n }\n uint256 absoluteInitialValue;\n unchecked {\n absoluteInitialValue = initialValue > deviationReference\n ? uint256(int256(initialValue) - int256(deviationReference))\n : uint256(int256(deviationReference) - int256(initialValue));\n }\n if (absoluteInitialValue == 0) {\n return type(uint256).max;\n }\n uint256 absoluteDelta = delta > 0 ? uint256(delta) : uint256(-delta);\n updateInPercentage =\n (absoluteDelta * HUNDRED_PERCENT) /\n absoluteInitialValue;\n }\n}\n" + }, + "contracts/api3-server-v1/extensions/BeaconUpdatesWithRrp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../DataFeedServer.sol\";\nimport \"./interfaces/IBeaconUpdatesWithRrp.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"../../protocol/interfaces/IAirnodeProtocol.sol\";\n\n/// @title Contract that updates Beacons using regular and relayed RRP\ncontract BeaconUpdatesWithRrp is DataFeedServer, IBeaconUpdatesWithRrp {\n using ECDSA for bytes32;\n\n /// @notice AirnodeProtocol contract address\n address public immutable override airnodeProtocol;\n\n /// @notice If a sponsor has permitted an account to request RRP-based\n /// updates at this contract\n mapping(address => mapping(address => bool))\n public\n override sponsorToRrpBeaconUpdateRequesterToPermissionStatus;\n\n mapping(bytes32 => bytes32) private requestIdToBeaconId;\n\n /// @dev Reverts if the sender is not the AirnodeProtocol contract\n modifier onlyAirnodeProtocol() {\n require(\n msg.sender == address(airnodeProtocol),\n \"Sender not Airnode protocol\"\n );\n _;\n }\n\n /// @dev Reverts if the sender is not permitted to request an RRP-based\n /// update with the sponsor and is not the sponsor\n /// @param sponsor Sponsor address\n modifier onlyPermittedUpdateRequester(address sponsor) {\n require(\n sponsor == msg.sender ||\n sponsorToRrpBeaconUpdateRequesterToPermissionStatus[sponsor][\n msg.sender\n ],\n \"Sender not permitted\"\n );\n _;\n }\n\n /// @param _airnodeProtocol AirnodeProtocol contract address\n constructor(address _airnodeProtocol) {\n require(_airnodeProtocol != address(0), \"AirnodeProtocol address zero\");\n airnodeProtocol = _airnodeProtocol;\n }\n\n /// @notice Called by the sponsor to set the update request permission\n /// status of an account\n /// @param rrpBeaconUpdateRequester RRP-based Beacon update requester\n /// address\n /// @param status Permission status\n function setRrpBeaconUpdatePermissionStatus(\n address rrpBeaconUpdateRequester,\n bool status\n ) external override {\n require(\n rrpBeaconUpdateRequester != address(0),\n \"Update requester zero\"\n );\n sponsorToRrpBeaconUpdateRequesterToPermissionStatus[msg.sender][\n rrpBeaconUpdateRequester\n ] = status;\n emit SetRrpBeaconUpdatePermissionStatus(\n msg.sender,\n rrpBeaconUpdateRequester,\n status\n );\n }\n\n /// @notice Creates an RRP request for the Beacon to be updated\n /// @dev In addition to the sponsor sponsoring this contract (by calling\n /// `setRrpSponsorshipStatus()`), the sponsor must also give update request\n /// permission to the sender (by calling\n /// `setRrpBeaconUpdatePermissionStatus()`) before this method is called.\n /// The template must specify a single point of data of type `int256` to be\n /// returned and for it to be small enough to be castable to `int224`\n /// because this is what `fulfillRrpBeaconUpdate()` expects.\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param sponsor Sponsor address\n /// @return requestId Request ID\n function requestRrpBeaconUpdateWithTemplate(\n address airnode,\n bytes32 templateId,\n address sponsor\n )\n external\n override\n onlyPermittedUpdateRequester(sponsor)\n returns (bytes32 requestId)\n {\n bytes32 beaconId = deriveBeaconId(airnode, templateId);\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequest(\n airnode,\n templateId,\n \"\",\n sponsor,\n this.fulfillRrpBeaconUpdate.selector\n );\n requestIdToBeaconId[requestId] = beaconId;\n emit RequestedRrpBeaconUpdate(\n beaconId,\n airnode,\n templateId,\n sponsor,\n requestId,\n msg.sender\n );\n }\n\n /// @notice Creates an RRP request for the Beacon to be updated\n /// @param airnode Airnode address\n /// @param endpointId Endpoint ID\n /// @param parameters Parameters\n /// @param sponsor Sponsor address\n /// @return requestId Request ID\n function requestRrpBeaconUpdateWithEndpoint(\n address airnode,\n bytes32 endpointId,\n bytes calldata parameters,\n address sponsor\n )\n external\n override\n onlyPermittedUpdateRequester(sponsor)\n returns (bytes32 requestId)\n {\n bytes32 templateId = keccak256(\n abi.encodePacked(endpointId, parameters)\n );\n bytes32 beaconId = deriveBeaconId(airnode, templateId);\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequest(\n airnode,\n endpointId,\n parameters,\n sponsor,\n this.fulfillRrpBeaconUpdate.selector\n );\n requestIdToBeaconId[requestId] = beaconId;\n emit RequestedRrpBeaconUpdate(\n beaconId,\n airnode,\n templateId,\n sponsor,\n requestId,\n msg.sender\n );\n }\n\n /// @notice Creates an RRP request for the Beacon to be updated by the relayer\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @return requestId Request ID\n function requestRelayedRrpBeaconUpdateWithTemplate(\n address airnode,\n bytes32 templateId,\n address relayer,\n address sponsor\n )\n external\n override\n onlyPermittedUpdateRequester(sponsor)\n returns (bytes32 requestId)\n {\n bytes32 beaconId = deriveBeaconId(airnode, templateId);\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequestRelayed(\n airnode,\n templateId,\n \"\",\n relayer,\n sponsor,\n this.fulfillRrpBeaconUpdate.selector\n );\n requestIdToBeaconId[requestId] = beaconId;\n emit RequestedRelayedRrpBeaconUpdate(\n beaconId,\n airnode,\n templateId,\n relayer,\n sponsor,\n requestId,\n msg.sender\n );\n }\n\n /// @notice Creates an RRP request for the Beacon to be updated by the relayer\n /// @param airnode Airnode address\n /// @param endpointId Endpoint ID\n /// @param parameters Parameters\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @return requestId Request ID\n function requestRelayedRrpBeaconUpdateWithEndpoint(\n address airnode,\n bytes32 endpointId,\n bytes calldata parameters,\n address relayer,\n address sponsor\n )\n external\n override\n onlyPermittedUpdateRequester(sponsor)\n returns (bytes32 requestId)\n {\n bytes32 templateId = keccak256(\n abi.encodePacked(endpointId, parameters)\n );\n bytes32 beaconId = deriveBeaconId(airnode, templateId);\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequestRelayed(\n airnode,\n endpointId,\n parameters,\n relayer,\n sponsor,\n this.fulfillRrpBeaconUpdate.selector\n );\n requestIdToBeaconId[requestId] = beaconId;\n emit RequestedRelayedRrpBeaconUpdate(\n beaconId,\n airnode,\n templateId,\n relayer,\n sponsor,\n requestId,\n msg.sender\n );\n }\n\n /// @notice Called by the Airnode/relayer using the sponsor wallet through\n /// AirnodeProtocol to fulfill the request\n /// @param requestId Request ID\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n function fulfillRrpBeaconUpdate(\n bytes32 requestId,\n uint256 timestamp,\n bytes calldata data\n ) external override onlyAirnodeProtocol {\n bytes32 beaconId = requestIdToBeaconId[requestId];\n delete requestIdToBeaconId[requestId];\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\n // Timestamp validity is already checked by `onlyValidTimestamp`, which\n // means it will be small enough to be typecast into `uint32`\n emit UpdatedBeaconWithRrp(\n beaconId,\n requestId,\n updatedValue,\n uint32(timestamp)\n );\n }\n}\n" + }, + "contracts/api3-server-v1/extensions/DataFeedUpdatesWithPsp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./BeaconSetUpdatesWithPsp.sol\";\nimport \"./interfaces/IDataFeedUpdatesWithPsp.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract that updates Beacons and Beacon sets using regular and\n/// relayed PSP\n/// @dev DataFeedUpdatesWithPsp is a PSP requester contract. Unlike RRP, which\n/// is implemented as a central contract, PSP implementation is built into the\n/// requester for optimization. Accordingly, the checks that are not required\n/// are omitted. An example:\n/// - While executing a PSP Beacon update, the condition is not verified\n/// because Beacon updates where the condition returns `false` (e.g., the\n/// on-chain value is already close to the actual value) are not harmful, and\n/// are even desirable (\"any update is a good update\").\ncontract DataFeedUpdatesWithPsp is\n BeaconSetUpdatesWithPsp,\n IDataFeedUpdatesWithPsp\n{\n using ECDSA for bytes32;\n\n /// @notice ID of the Beacon that the subscription is registered to update\n mapping(bytes32 => bytes32) public override subscriptionIdToBeaconId;\n\n mapping(bytes32 => bytes32) private subscriptionIdToHash;\n\n /// @notice Registers the Beacon update subscription\n /// @dev Similar to how one needs to call `requestRrpBeaconUpdate()` for\n /// this contract to recognize the incoming RRP fulfillment, this needs to\n /// be called before the subscription fulfillments.\n /// In addition to the subscription being registered, the sponsor must use\n /// `setPspSponsorshipStatus()` to give permission for its sponsor wallet\n /// to be used for the specific subscription.\n /// @param airnode Airnode address\n /// @param templateId Template ID\n /// @param conditions Conditions under which the subscription is requested\n /// to be fulfilled\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @return subscriptionId Subscription ID\n function registerBeaconUpdateSubscription(\n address airnode,\n bytes32 templateId,\n bytes calldata conditions,\n address relayer,\n address sponsor\n ) external override returns (bytes32 subscriptionId) {\n require(relayer != address(0), \"Relayer address zero\");\n require(sponsor != address(0), \"Sponsor address zero\");\n subscriptionId = keccak256(\n abi.encode(\n block.chainid,\n airnode,\n templateId,\n \"\",\n conditions,\n relayer,\n sponsor,\n address(this),\n this.fulfillPspBeaconUpdate.selector\n )\n );\n require(\n subscriptionIdToHash[subscriptionId] == bytes32(0),\n \"Subscription already registered\"\n );\n subscriptionIdToHash[subscriptionId] = keccak256(\n abi.encodePacked(airnode, relayer, sponsor)\n );\n bytes32 beaconId = deriveBeaconId(airnode, templateId);\n subscriptionIdToBeaconId[subscriptionId] = beaconId;\n emit RegisteredBeaconUpdateSubscription(\n beaconId,\n subscriptionId,\n airnode,\n templateId,\n conditions,\n relayer,\n sponsor\n );\n }\n\n /// @notice Returns if the respective Beacon needs to be updated based on\n /// the fulfillment data and the condition parameters\n /// @dev `conditionParameters` are specified within the `conditions` field\n /// of a Subscription.\n /// Even if this function returns `true`, the respective Subscription\n /// fulfillment will fail if the Beacon is updated with a larger timestamp\n /// in the meantime.\n /// @param subscriptionId Subscription ID\n /// @param data Fulfillment data (an `int256` encoded in contract ABI)\n /// @param conditionParameters Subscription condition parameters. This\n /// includes multiple ABI-encoded values, see `checkUpdateCondition()`.\n /// @return If the Beacon update subscription should be fulfilled\n function conditionPspBeaconUpdate(\n bytes32 subscriptionId,\n bytes calldata data,\n bytes calldata conditionParameters\n ) public view virtual override returns (bool) {\n bytes32 beaconId = subscriptionIdToBeaconId[subscriptionId];\n require(beaconId != bytes32(0), \"Subscription not registered\");\n return\n checkUpdateCondition(\n beaconId,\n decodeFulfillmentData(data),\n uint32(block.timestamp),\n conditionParameters\n );\n }\n\n /// @notice Called by the Airnode/relayer using the sponsor wallet to\n /// fulfill the Beacon update subscription\n /// @dev There is no need to verify that `conditionPspBeaconUpdate()`\n /// returns `true` because any Beacon update is a good Beacon update as\n /// long as it increases the timestamp\n /// @param subscriptionId Subscription ID\n /// @param airnode Airnode address\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data (a single `int256` encoded in contract\n /// ABI)\n /// @param signature Subscription ID, timestamp, sponsor wallet address\n /// (and fulfillment data if the relayer is not the Airnode) signed by the\n /// Airnode wallet\n function fulfillPspBeaconUpdate(\n bytes32 subscriptionId,\n address airnode,\n address relayer,\n address sponsor,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override {\n require(\n subscriptionIdToHash[subscriptionId] ==\n keccak256(abi.encodePacked(airnode, relayer, sponsor)),\n \"Subscription not registered\"\n );\n if (airnode == relayer) {\n require(\n (\n keccak256(\n abi.encodePacked(subscriptionId, timestamp, msg.sender)\n ).toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n } else {\n require(\n (\n keccak256(\n abi.encodePacked(\n subscriptionId,\n timestamp,\n msg.sender,\n data\n )\n ).toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n }\n bytes32 beaconId = subscriptionIdToBeaconId[subscriptionId];\n // Beacon ID is guaranteed to not be zero because the subscription is\n // registered\n int224 updatedValue = processBeaconUpdate(beaconId, timestamp, data);\n // Timestamp validity is already checked by `onlyValidTimestamp`, which\n // means it will be small enough to be typecast into `uint32`\n emit UpdatedBeaconWithPsp(\n beaconId,\n subscriptionId,\n updatedValue,\n uint32(timestamp)\n );\n }\n}\n" + }, + "contracts/api3-server-v1/extensions/interfaces/IBeaconSetUpdatesWithPsp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/IDataFeedServer.sol\";\n\ninterface IBeaconSetUpdatesWithPsp is IDataFeedServer {\n function conditionPspBeaconSetUpdate(\n bytes32 subscriptionId,\n bytes calldata data,\n bytes calldata conditionParameters\n ) external view returns (bool);\n\n function fulfillPspBeaconSetUpdate(\n bytes32 subscriptionId,\n address airnode,\n address relayer,\n address sponsor,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external;\n\n // solhint-disable-next-line func-name-mixedcase\n function HUNDRED_PERCENT() external view returns (uint256);\n}\n" + }, + "contracts/api3-server-v1/extensions/interfaces/IBeaconUpdatesWithRrp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/IDataFeedServer.sol\";\n\ninterface IBeaconUpdatesWithRrp is IDataFeedServer {\n event SetRrpBeaconUpdatePermissionStatus(\n address indexed sponsor,\n address indexed requester,\n bool status\n );\n\n event RequestedRrpBeaconUpdate(\n bytes32 indexed beaconId,\n address airnode,\n bytes32 templateId,\n address sponsor,\n bytes32 requestId,\n address requester\n );\n\n event RequestedRelayedRrpBeaconUpdate(\n bytes32 indexed beaconId,\n address airnode,\n bytes32 templateId,\n address relayer,\n address sponsor,\n bytes32 requestId,\n address requester\n );\n\n event UpdatedBeaconWithRrp(\n bytes32 indexed beaconId,\n bytes32 requestId,\n int224 value,\n uint32 timestamp\n );\n\n function setRrpBeaconUpdatePermissionStatus(\n address rrpBeaconUpdateRequester,\n bool status\n ) external;\n\n function requestRrpBeaconUpdateWithTemplate(\n address airnode,\n bytes32 templateId,\n address sponsor\n ) external returns (bytes32 requestId);\n\n function requestRrpBeaconUpdateWithEndpoint(\n address airnode,\n bytes32 endpointId,\n bytes calldata parameters,\n address sponsor\n ) external returns (bytes32 requestId);\n\n function requestRelayedRrpBeaconUpdateWithTemplate(\n address airnode,\n bytes32 templateId,\n address relayer,\n address sponsor\n ) external returns (bytes32 requestId);\n\n function requestRelayedRrpBeaconUpdateWithEndpoint(\n address airnode,\n bytes32 endpointId,\n bytes calldata parameters,\n address relayer,\n address sponsor\n ) external returns (bytes32 requestId);\n\n function fulfillRrpBeaconUpdate(\n bytes32 requestId,\n uint256 timestamp,\n bytes calldata data\n ) external;\n\n function airnodeProtocol() external view returns (address);\n\n function sponsorToRrpBeaconUpdateRequesterToPermissionStatus(\n address sponsor,\n address updateRequester\n ) external view returns (bool);\n}\n" + }, + "contracts/api3-server-v1/extensions/interfaces/IDataFeedUpdatesWithPsp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IBeaconSetUpdatesWithPsp.sol\";\n\ninterface IDataFeedUpdatesWithPsp is IBeaconSetUpdatesWithPsp {\n event RegisteredBeaconUpdateSubscription(\n bytes32 indexed beaconId,\n bytes32 subscriptionId,\n address airnode,\n bytes32 templateId,\n bytes conditions,\n address relayer,\n address sponsor\n );\n\n event UpdatedBeaconWithPsp(\n bytes32 indexed beaconId,\n bytes32 subscriptionId,\n int224 value,\n uint32 timestamp\n );\n\n function registerBeaconUpdateSubscription(\n address airnode,\n bytes32 templateId,\n bytes memory conditions,\n address relayer,\n address sponsor\n ) external returns (bytes32 subscriptionId);\n\n function conditionPspBeaconUpdate(\n bytes32 subscriptionId,\n bytes calldata data,\n bytes calldata conditionParameters\n ) external view returns (bool);\n\n function fulfillPspBeaconUpdate(\n bytes32 subscriptionId,\n address airnode,\n address relayer,\n address sponsor,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external;\n\n function subscriptionIdToBeaconId(\n bytes32 subscriptionId\n ) external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/extensions/mock/DataFeedServerFull.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../../Api3ServerV1.sol\";\nimport \"../BeaconUpdatesWithRrp.sol\";\nimport \"../DataFeedUpdatesWithPsp.sol\";\n\ncontract DataFeedServerFull is\n Api3ServerV1,\n BeaconUpdatesWithRrp,\n DataFeedUpdatesWithPsp\n{\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager,\n address _airnodeProtocol\n )\n Api3ServerV1(_accessControlRegistry, _adminRoleDescription, _manager)\n BeaconUpdatesWithRrp(_airnodeProtocol)\n {}\n}\n" + }, + "contracts/api3-server-v1/interfaces/IApi3ServerV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IOevDapiServer.sol\";\nimport \"./IBeaconUpdatesWithSignedData.sol\";\n\ninterface IApi3ServerV1 is IOevDapiServer, IBeaconUpdatesWithSignedData {\n function readDataFeedWithId(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithDapiNameHash(\n bytes32 dapiNameHash\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) external view returns (int224 value, uint32 timestamp);\n\n function dataFeeds(\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n\n function oevProxyToIdToDataFeed(\n address proxy,\n bytes32 dataFeedId\n ) external view returns (int224 value, uint32 timestamp);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IBeaconUpdatesWithSignedData.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IDataFeedServer.sol\";\n\ninterface IBeaconUpdatesWithSignedData is IDataFeedServer {\n function updateBeaconWithSignedData(\n address airnode,\n bytes32 templateId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external returns (bytes32 beaconId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\nimport \"./IDataFeedServer.sol\";\n\ninterface IDapiServer is\n IAccessControlRegistryAdminnedWithManager,\n IDataFeedServer\n{\n event SetDapiName(\n bytes32 indexed dataFeedId,\n bytes32 indexed dapiName,\n address sender\n );\n\n function setDapiName(bytes32 dapiName, bytes32 dataFeedId) external;\n\n function dapiNameToDataFeedId(\n bytes32 dapiName\n ) external view returns (bytes32);\n\n // solhint-disable-next-line func-name-mixedcase\n function DAPI_NAME_SETTER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function dapiNameSetterRole() external view returns (bytes32);\n\n function dapiNameHashToDataFeedId(\n bytes32 dapiNameHash\n ) external view returns (bytes32 dataFeedId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../utils/interfaces/IExtendedSelfMulticall.sol\";\n\ninterface IDataFeedServer is IExtendedSelfMulticall {\n event UpdatedBeaconWithSignedData(\n bytes32 indexed beaconId,\n int224 value,\n uint32 timestamp\n );\n\n event UpdatedBeaconSetWithBeacons(\n bytes32 indexed beaconSetId,\n int224 value,\n uint32 timestamp\n );\n\n function updateBeaconSetWithBeacons(\n bytes32[] memory beaconIds\n ) external returns (bytes32 beaconSetId);\n}\n" + }, + "contracts/api3-server-v1/interfaces/IOevDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IOevDataFeedServer.sol\";\nimport \"./IDapiServer.sol\";\n\ninterface IOevDapiServer is IOevDataFeedServer, IDapiServer {}\n" + }, + "contracts/api3-server-v1/interfaces/IOevDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IDataFeedServer.sol\";\n\ninterface IOevDataFeedServer is IDataFeedServer {\n event UpdatedOevProxyBeaconWithSignedData(\n bytes32 indexed beaconId,\n address indexed proxy,\n bytes32 indexed updateId,\n int224 value,\n uint32 timestamp\n );\n\n event UpdatedOevProxyBeaconSetWithSignedData(\n bytes32 indexed beaconSetId,\n address indexed proxy,\n bytes32 indexed updateId,\n int224 value,\n uint32 timestamp\n );\n\n event Withdrew(\n address indexed oevProxy,\n address oevBeneficiary,\n uint256 amount\n );\n\n function updateOevProxyDataFeedWithSignedData(\n address oevProxy,\n bytes32 dataFeedId,\n bytes32 updateId,\n uint256 timestamp,\n bytes calldata data,\n bytes[] calldata packedOevUpdateSignatures\n ) external payable;\n\n function withdraw(address oevProxy) external;\n\n function oevProxyToBalance(\n address oevProxy\n ) external view returns (uint256 balance);\n}\n" + }, + "contracts/api3-server-v1/OevDapiServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./OevDataFeedServer.sol\";\nimport \"./DapiServer.sol\";\nimport \"./interfaces/IOevDapiServer.sol\";\n\n/// @title Contract that serves OEV dAPIs\ncontract OevDapiServer is OevDataFeedServer, DapiServer, IOevDapiServer {\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n ) DapiServer(_accessControlRegistry, _adminRoleDescription, _manager) {}\n\n /// @notice Reads the data feed as the OEV proxy with dAPI name hash\n /// @param dapiNameHash dAPI name hash\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithDapiNameHashAsOevProxy(\n bytes32 dapiNameHash\n ) internal view returns (int224 value, uint32 timestamp) {\n bytes32 dataFeedId = dapiNameHashToDataFeedId[dapiNameHash];\n require(dataFeedId != bytes32(0), \"dAPI name not set\");\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\n dataFeedId\n ];\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\n } else {\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n require(timestamp > 0, \"Data feed not initialized\");\n }\n}\n" + }, + "contracts/api3-server-v1/OevDataFeedServer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./DataFeedServer.sol\";\nimport \"./interfaces/IOevDataFeedServer.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"./proxies/interfaces/IOevProxy.sol\";\n\n/// @title Contract that serves OEV Beacons and Beacon sets\n/// @notice OEV Beacons and Beacon sets can be updated by the winner of the\n/// respective OEV auctions. The beneficiary can withdraw the proceeds from\n/// this contract.\ncontract OevDataFeedServer is DataFeedServer, IOevDataFeedServer {\n using ECDSA for bytes32;\n\n /// @notice Data feed with ID specific to the OEV proxy\n /// @dev This implies that an update as a result of an OEV auction only\n /// affects contracts that read through the respective proxy that the\n /// auction was being held for\n mapping(address => mapping(bytes32 => DataFeed))\n internal _oevProxyToIdToDataFeed;\n\n /// @notice Accumulated OEV auction proceeds for the specific proxy\n mapping(address => uint256) public override oevProxyToBalance;\n\n /// @notice Updates a data feed that the OEV proxy reads using the\n /// aggregation signed by the absolute majority of the respective Airnodes\n /// for the specific bid\n /// @dev For when the data feed being updated is a Beacon set, an absolute\n /// majority of the Airnodes that power the respective Beacons must sign\n /// the aggregated value and timestamp. While doing so, the Airnodes should\n /// refer to data signed to update an absolute majority of the respective\n /// Beacons. The Airnodes should require the data to be fresh enough (e.g.,\n /// at most 2 minutes-old), and tightly distributed around the resulting\n /// aggregation (e.g., within 1% deviation), and reject to provide an OEV\n /// proxy data feed update signature if these are not satisfied.\n /// @param oevProxy OEV proxy that reads the data feed\n /// @param dataFeedId Data feed ID\n /// @param updateId Update ID\n /// @param timestamp Signature timestamp\n /// @param data Update data (an `int256` encoded in contract ABI)\n /// @param packedOevUpdateSignatures Packed OEV update signatures, which\n /// include the Airnode address, template ID and these signed with the OEV\n /// update hash\n function updateOevProxyDataFeedWithSignedData(\n address oevProxy,\n bytes32 dataFeedId,\n bytes32 updateId,\n uint256 timestamp,\n bytes calldata data,\n bytes[] calldata packedOevUpdateSignatures\n ) external payable override onlyValidTimestamp(timestamp) {\n require(\n timestamp > _oevProxyToIdToDataFeed[oevProxy][dataFeedId].timestamp,\n \"Does not update timestamp\"\n );\n bytes32 oevUpdateHash = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n oevProxy,\n dataFeedId,\n updateId,\n timestamp,\n data,\n msg.sender,\n msg.value\n )\n );\n int224 updatedValue = decodeFulfillmentData(data);\n uint32 updatedTimestamp = uint32(timestamp);\n uint256 beaconCount = packedOevUpdateSignatures.length;\n if (beaconCount > 1) {\n bytes32[] memory beaconIds = new bytes32[](beaconCount);\n uint256 validSignatureCount;\n for (uint256 ind = 0; ind < beaconCount; ) {\n bool signatureIsNotOmitted;\n (\n signatureIsNotOmitted,\n beaconIds[ind]\n ) = unpackAndValidateOevUpdateSignature(\n oevUpdateHash,\n packedOevUpdateSignatures[ind]\n );\n if (signatureIsNotOmitted) {\n unchecked {\n validSignatureCount++;\n }\n }\n unchecked {\n ind++;\n }\n }\n // \"Greater than or equal to\" is not enough because full control\n // of aggregation requires an absolute majority\n require(\n validSignatureCount > beaconCount / 2,\n \"Not enough signatures\"\n );\n require(\n dataFeedId == deriveBeaconSetId(beaconIds),\n \"Beacon set ID mismatch\"\n );\n emit UpdatedOevProxyBeaconSetWithSignedData(\n dataFeedId,\n oevProxy,\n updateId,\n updatedValue,\n updatedTimestamp\n );\n } else if (beaconCount == 1) {\n {\n (\n bool signatureIsNotOmitted,\n bytes32 beaconId\n ) = unpackAndValidateOevUpdateSignature(\n oevUpdateHash,\n packedOevUpdateSignatures[0]\n );\n require(signatureIsNotOmitted, \"Missing signature\");\n require(dataFeedId == beaconId, \"Beacon ID mismatch\");\n }\n emit UpdatedOevProxyBeaconWithSignedData(\n dataFeedId,\n oevProxy,\n updateId,\n updatedValue,\n updatedTimestamp\n );\n } else {\n revert(\"Did not specify any Beacons\");\n }\n _oevProxyToIdToDataFeed[oevProxy][dataFeedId] = DataFeed({\n value: updatedValue,\n timestamp: updatedTimestamp\n });\n oevProxyToBalance[oevProxy] += msg.value;\n }\n\n /// @notice Withdraws the balance of the OEV proxy to the respective\n /// beneficiary account\n /// @dev This does not require the caller to be the beneficiary because we\n /// expect that in most cases, the OEV beneficiary will be a contract that\n /// will not be able to make arbitrary calls. Our choice can be worked\n /// around by implementing a beneficiary proxy.\n /// @param oevProxy OEV proxy\n function withdraw(address oevProxy) external override {\n address oevBeneficiary = IOevProxy(oevProxy).oevBeneficiary();\n require(oevBeneficiary != address(0), \"Beneficiary address zero\");\n uint256 balance = oevProxyToBalance[oevProxy];\n require(balance != 0, \"OEV proxy balance zero\");\n oevProxyToBalance[oevProxy] = 0;\n emit Withdrew(oevProxy, oevBeneficiary, balance);\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = oevBeneficiary.call{value: balance}(\"\");\n require(success, \"Withdrawal reverted\");\n }\n\n /// @notice Reads the data feed as the OEV proxy with ID\n /// @param dataFeedId Data feed ID\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function _readDataFeedWithIdAsOevProxy(\n bytes32 dataFeedId\n ) internal view returns (int224 value, uint32 timestamp) {\n DataFeed storage oevDataFeed = _oevProxyToIdToDataFeed[msg.sender][\n dataFeedId\n ];\n DataFeed storage dataFeed = _dataFeeds[dataFeedId];\n if (oevDataFeed.timestamp > dataFeed.timestamp) {\n (value, timestamp) = (oevDataFeed.value, oevDataFeed.timestamp);\n } else {\n (value, timestamp) = (dataFeed.value, dataFeed.timestamp);\n }\n require(timestamp > 0, \"Data feed not initialized\");\n }\n\n /// @notice Called privately to unpack and validate the OEV update\n /// signature\n /// @param oevUpdateHash OEV update hash\n /// @param packedOevUpdateSignature Packed OEV update signature, which\n /// includes the Airnode address, template ID and these signed with the OEV\n /// update hash\n /// @return signatureIsNotOmitted If the signature is omitted in\n /// `packedOevUpdateSignature`\n /// @return beaconId Beacon ID\n function unpackAndValidateOevUpdateSignature(\n bytes32 oevUpdateHash,\n bytes calldata packedOevUpdateSignature\n ) private pure returns (bool signatureIsNotOmitted, bytes32 beaconId) {\n (address airnode, bytes32 templateId, bytes memory signature) = abi\n .decode(packedOevUpdateSignature, (address, bytes32, bytes));\n beaconId = deriveBeaconId(airnode, templateId);\n if (signature.length != 0) {\n require(\n (\n keccak256(abi.encodePacked(oevUpdateHash, templateId))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n signatureIsNotOmitted = true;\n }\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DapiProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IDapiProxy.sol\";\nimport \"../interfaces/IApi3ServerV1.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific dAPI of\n/// a specific Api3ServerV1 contract\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev The proxy contracts are generalized to support most types of numerical\n/// data feeds. This means that the user of this proxy is expected to validate\n/// the read values according to the specific use-case. For example, `value` is\n/// a signed integer, yet it being negative may not make sense in the case that\n/// the data feed represents the spot price of an asset. In that case, the user\n/// is responsible with ensuring that `value` is not negative.\n/// In the case that the data feed is from a single source, `timestamp` is the\n/// system time of the Airnode when it signed the data. In the case that the\n/// data feed is from multiple sources, `timestamp` is the median of system\n/// times of the Airnodes when they signed the respective data. There are two\n/// points to consider while using `timestamp` in your contract logic: (1) It\n/// is based on the system time of the Airnodes, and not the block timestamp.\n/// This may be relevant when either of them drifts. (2) `timestamp` is an\n/// off-chain value that is being reported, similar to `value`. Both should\n/// only be trusted as much as the Airnode(s) that report them.\ncontract DapiProxy is IDapiProxy {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n /// @notice Hash of the dAPI name\n bytes32 public immutable override dapiNameHash;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dapiNameHash Hash of the dAPI name\n constructor(address _api3ServerV1, bytes32 _dapiNameHash) {\n api3ServerV1 = _api3ServerV1;\n dapiNameHash = _dapiNameHash;\n }\n\n /// @notice Reads the dAPI that this proxy maps to\n /// @return value dAPI value\n /// @return timestamp dAPI timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithDapiNameHash(dapiNameHash);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DapiProxyWithOev.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DapiProxy.sol\";\nimport \"./interfaces/IOevProxy.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific dAPI of\n/// a specific Api3ServerV1 contract and inform Api3ServerV1 about the\n/// beneficiary of the respective OEV proceeds\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DapiProxyWithOev is DapiProxy, IOevProxy {\n /// @notice OEV beneficiary address\n address public immutable override oevBeneficiary;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dapiNameHash Hash of the dAPI name\n /// @param _oevBeneficiary OEV beneficiary\n constructor(\n address _api3ServerV1,\n bytes32 _dapiNameHash,\n address _oevBeneficiary\n ) DapiProxy(_api3ServerV1, _dapiNameHash) {\n oevBeneficiary = _oevBeneficiary;\n }\n\n /// @notice Reads the dAPI that this proxy maps to\n /// @return value dAPI value\n /// @return timestamp dAPI timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithDapiNameHashAsOevProxy(dapiNameHash);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DataFeedProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IDataFeedProxy.sol\";\nimport \"../interfaces/IApi3ServerV1.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific data\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DataFeedProxy is IDataFeedProxy {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n /// @notice Data feed ID\n bytes32 public immutable override dataFeedId;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\n constructor(address _api3ServerV1, bytes32 _dataFeedId) {\n api3ServerV1 = _api3ServerV1;\n dataFeedId = _dataFeedId;\n }\n\n /// @notice Reads the data feed that this proxy maps to\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1).readDataFeedWithId(\n dataFeedId\n );\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/DataFeedProxyWithOev.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DataFeedProxy.sol\";\nimport \"./interfaces/IOevProxy.sol\";\n\n/// @title An immutable proxy contract that is used to read a specific data\n/// feed (Beacon or Beacon set) of a specific Api3ServerV1 contract and inform\n/// Api3ServerV1 about the beneficiary of the respective OEV proceeds\n/// @notice In an effort to reduce the bytecode of this contract, its\n/// constructor arguments are validated by ProxyFactory, rather than\n/// internally. If you intend to deploy this contract without using\n/// ProxyFactory, you are recommended to implement an equivalent validation.\n/// @dev See DapiProxy.sol for comments about usage\ncontract DataFeedProxyWithOev is DataFeedProxy, IOevProxy {\n /// @notice OEV beneficiary address\n address public immutable override oevBeneficiary;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n /// @param _dataFeedId Data feed (Beacon or Beacon set) ID\n /// @param _oevBeneficiary OEV beneficiary\n constructor(\n address _api3ServerV1,\n bytes32 _dataFeedId,\n address _oevBeneficiary\n ) DataFeedProxy(_api3ServerV1, _dataFeedId) {\n oevBeneficiary = _oevBeneficiary;\n }\n\n /// @notice Reads the data feed that this proxy maps to\n /// @return value Data feed value\n /// @return timestamp Data feed timestamp\n function read()\n external\n view\n virtual\n override\n returns (int224 value, uint32 timestamp)\n {\n (value, timestamp) = IApi3ServerV1(api3ServerV1)\n .readDataFeedWithIdAsOevProxy(dataFeedId);\n }\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IDapiProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IProxy.sol\";\n\ninterface IDapiProxy is IProxy {\n function dapiNameHash() external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IDataFeedProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./IProxy.sol\";\n\ninterface IDataFeedProxy is IProxy {\n function dataFeedId() external view returns (bytes32);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IOevProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOevProxy {\n function oevBeneficiary() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @dev See DapiProxy.sol for comments about usage\ninterface IProxy {\n function read() external view returns (int224 value, uint32 timestamp);\n\n function api3ServerV1() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/interfaces/IProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IProxyFactory {\n event DeployedDataFeedProxy(\n address indexed proxyAddress,\n bytes32 indexed dataFeedId,\n bytes metadata\n );\n\n event DeployedDapiProxy(\n address indexed proxyAddress,\n bytes32 indexed dapiName,\n bytes metadata\n );\n\n event DeployedDataFeedProxyWithOev(\n address indexed proxyAddress,\n bytes32 indexed dataFeedId,\n address oevBeneficiary,\n bytes metadata\n );\n\n event DeployedDapiProxyWithOev(\n address indexed proxyAddress,\n bytes32 indexed dapiName,\n address oevBeneficiary,\n bytes metadata\n );\n\n function deployDataFeedProxy(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDataFeedProxyWithOev(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external returns (address proxyAddress);\n\n function computeDataFeedProxyAddress(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDapiProxyAddress(\n bytes32 dapiName,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDataFeedProxyWithOevAddress(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function computeDapiProxyWithOevAddress(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view returns (address proxyAddress);\n\n function api3ServerV1() external view returns (address);\n}\n" + }, + "contracts/api3-server-v1/proxies/ProxyFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./DataFeedProxy.sol\";\nimport \"./DapiProxy.sol\";\nimport \"./DataFeedProxyWithOev.sol\";\nimport \"./DapiProxyWithOev.sol\";\nimport \"./interfaces/IProxyFactory.sol\";\nimport \"@openzeppelin/contracts/utils/Create2.sol\";\n\n/// @title Contract factory that deterministically deploys proxies that read\n/// data feeds (Beacons or Beacon sets) or dAPIs, along with optional OEV\n/// support\n/// @dev The proxies are deployed normally and not cloned to minimize the gas\n/// cost overhead while using them to read data feed values\ncontract ProxyFactory is IProxyFactory {\n /// @notice Api3ServerV1 address\n address public immutable override api3ServerV1;\n\n /// @param _api3ServerV1 Api3ServerV1 address\n constructor(address _api3ServerV1) {\n require(_api3ServerV1 != address(0), \"Api3ServerV1 address zero\");\n api3ServerV1 = _api3ServerV1;\n }\n\n /// @notice Deterministically deploys a data feed proxy\n /// @param dataFeedId Data feed ID\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDataFeedProxy(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n proxyAddress = address(\n new DataFeedProxy{salt: keccak256(metadata)}(\n api3ServerV1,\n dataFeedId\n )\n );\n emit DeployedDataFeedProxy(proxyAddress, dataFeedId, metadata);\n }\n\n /// @notice Deterministically deploys a dAPI proxy\n /// @param dapiName dAPI name\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxy(\n bytes32 dapiName,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n proxyAddress = address(\n new DapiProxy{salt: keccak256(metadata)}(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName))\n )\n );\n emit DeployedDapiProxy(proxyAddress, dapiName, metadata);\n }\n\n /// @notice Deterministically deploys a data feed proxy with OEV support\n /// @param dataFeedId Data feed ID\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDataFeedProxyWithOev(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = address(\n new DataFeedProxyWithOev{salt: keccak256(metadata)}(\n api3ServerV1,\n dataFeedId,\n oevBeneficiary\n )\n );\n emit DeployedDataFeedProxyWithOev(\n proxyAddress,\n dataFeedId,\n oevBeneficiary,\n metadata\n );\n }\n\n /// @notice Deterministically deploys a dAPI proxy with OEV support\n /// @param dapiName dAPI name\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function deployDapiProxyWithOev(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = address(\n new DapiProxyWithOev{salt: keccak256(metadata)}(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName)),\n oevBeneficiary\n )\n );\n emit DeployedDapiProxyWithOev(\n proxyAddress,\n dapiName,\n oevBeneficiary,\n metadata\n );\n }\n\n /// @notice Computes the address of the data feed proxy\n /// @param dataFeedId Data feed ID\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDataFeedProxyAddress(\n bytes32 dataFeedId,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DataFeedProxy).creationCode,\n abi.encode(api3ServerV1, dataFeedId)\n )\n )\n );\n }\n\n /// @notice Computes the address of the dAPI proxy\n /// @param dapiName dAPI name\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDapiProxyAddress(\n bytes32 dapiName,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DapiProxy).creationCode,\n abi.encode(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName))\n )\n )\n )\n );\n }\n\n /// @notice Computes the address of the data feed proxy with OEV support\n /// @param dataFeedId Data feed ID\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDataFeedProxyWithOevAddress(\n bytes32 dataFeedId,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dataFeedId != bytes32(0), \"Data feed ID zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DataFeedProxyWithOev).creationCode,\n abi.encode(api3ServerV1, dataFeedId, oevBeneficiary)\n )\n )\n );\n }\n\n /// @notice Computes the address of the dAPI proxy with OEV support\n /// @param dapiName dAPI name\n /// @param oevBeneficiary OEV beneficiary\n /// @param metadata Metadata associated with the proxy\n /// @return proxyAddress Proxy address\n function computeDapiProxyWithOevAddress(\n bytes32 dapiName,\n address oevBeneficiary,\n bytes calldata metadata\n ) external view override returns (address proxyAddress) {\n require(dapiName != bytes32(0), \"dAPI name zero\");\n require(oevBeneficiary != address(0), \"OEV beneficiary zero\");\n proxyAddress = Create2.computeAddress(\n keccak256(metadata),\n keccak256(\n abi.encodePacked(\n type(DapiProxyWithOev).creationCode,\n abi.encode(\n api3ServerV1,\n keccak256(abi.encodePacked(dapiName)),\n oevBeneficiary\n )\n )\n )\n );\n }\n}\n" + }, + "contracts/authorizers/interfaces/IRequesterAuthorizer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IRequesterAuthorizer {\n event ExtendedAuthorizationExpiration(\n address indexed airnode,\n address indexed requester,\n uint32 expirationTimestamp,\n address sender\n );\n\n event SetAuthorizationExpiration(\n address indexed airnode,\n address indexed requester,\n uint32 expirationTimestamp,\n address sender\n );\n\n event SetIndefiniteAuthorizationStatus(\n address indexed airnode,\n address indexed requester,\n bool status,\n uint224 indefiniteAuthorizationCount,\n address sender\n );\n\n event RevokedIndefiniteAuthorizationStatus(\n address indexed airnode,\n address indexed requester,\n address setter,\n uint224 indefiniteAuthorizationCount,\n address sender\n );\n\n function extendAuthorizerExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external;\n\n function setAuthorizationExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external;\n\n function setIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n bool status\n ) external;\n\n function revokeIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n address setter\n ) external;\n\n function isAuthorized(\n address airnode,\n address requester\n ) external view returns (bool);\n\n // solhint-disable-next-line func-name-mixedcase\n function AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function airnodeToRequesterToAuthorizationStatus(\n address airnode,\n address requester\n )\n external\n view\n returns (\n uint32 expirationTimestamp,\n uint224 indefiniteAuthorizationCount\n );\n\n function airnodeToRequesterToSetterToIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n address setter\n ) external view returns (bool indefiniteAuthorizationStatus);\n}\n" + }, + "contracts/authorizers/interfaces/IRequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\";\nimport \"./IRequesterAuthorizer.sol\";\n\ninterface IRequesterAuthorizerWithAirnode is\n IAccessControlRegistryAdminned,\n IRequesterAuthorizer\n{\n function deriveAdminRole(\n address airnode\n ) external view returns (bytes32 role);\n\n function deriveAuthorizationExpirationExtenderRole(\n address airnode\n ) external view returns (bytes32 role);\n\n function deriveAuthorizationExpirationSetterRole(\n address airnode\n ) external view returns (bytes32 role);\n\n function deriveIndefiniteAuthorizerRole(\n address airnode\n ) external view returns (bytes32 role);\n}\n" + }, + "contracts/authorizers/interfaces/IRequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\";\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminned.sol\";\n\ninterface IRequesterAuthorizerWithErc721 is\n IERC721Receiver,\n IAccessControlRegistryAdminned\n{\n enum DepositState {\n Inactive,\n Active,\n WithdrawalInitiated\n }\n\n event SetWithdrawalLeadTime(\n address indexed airnode,\n uint32 withdrawalLeadTime,\n address sender\n );\n\n event SetRequesterBlockStatus(\n address indexed airnode,\n address indexed requester,\n uint256 chainId,\n bool status,\n address sender\n );\n\n event SetDepositorFreezeStatus(\n address indexed airnode,\n address indexed depositor,\n bool status,\n address sender\n );\n\n event DepositedToken(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint256 tokenDepositCount\n );\n\n event UpdatedDepositRequesterFrom(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint256 tokenDepositCount\n );\n\n event UpdatedDepositRequesterTo(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint256 tokenDepositCount\n );\n\n event InitiatedTokenWithdrawal(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint32 earliestWithdrawalTime,\n uint256 tokenDepositCount\n );\n\n event WithdrewToken(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint256 tokenDepositCount\n );\n\n event RevokedToken(\n address indexed airnode,\n address indexed requester,\n address indexed depositor,\n uint256 chainId,\n address token,\n uint256 tokenId,\n uint256 tokenDepositCount\n );\n\n function setWithdrawalLeadTime(\n address airnode,\n uint32 withdrawalLeadTime\n ) external;\n\n function setRequesterBlockStatus(\n address airnode,\n uint256 chainId,\n address requester,\n bool status\n ) external;\n\n function setDepositorFreezeStatus(\n address airnode,\n address depositor,\n bool status\n ) external;\n\n function updateDepositRequester(\n address airnode,\n uint256 chainIdPrevious,\n address requesterPrevious,\n uint256 chainIdNext,\n address requesterNext,\n address token\n ) external;\n\n function initiateTokenWithdrawal(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external returns (uint32 earliestWithdrawalTime);\n\n function withdrawToken(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external;\n\n function revokeToken(\n address airnode,\n uint256 chainId,\n address requester,\n address token,\n address depositor\n ) external;\n\n function airnodeToChainIdToRequesterToTokenToDepositorToDeposit(\n address airnode,\n uint256 chainId,\n address requester,\n address token,\n address depositor\n )\n external\n view\n returns (\n uint256 tokenId,\n uint32 withdrawalLeadTime,\n uint32 earliestWithdrawalTime,\n DepositState depositState\n );\n\n function isAuthorized(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external view returns (bool);\n\n function deriveWithdrawalLeadTimeSetterRole(\n address airnode\n ) external view returns (bytes32 withdrawalLeadTimeSetterRole);\n\n function deriveRequesterBlockerRole(\n address airnode\n ) external view returns (bytes32 requesterBlockerRole);\n\n function deriveDepositorFreezerRole(\n address airnode\n ) external view returns (bytes32 depositorFreezerRole);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function REQUESTER_BLOCKER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function DEPOSITOR_FREEZER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function airnodeToChainIdToRequesterToTokenAddressToTokenDeposits(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external view returns (uint256 tokenDepositCount);\n\n function airnodeToWithdrawalLeadTime(\n address airnode\n ) external view returns (uint32 withdrawalLeadTime);\n\n function airnodeToChainIdToRequesterToBlockStatus(\n address airnode,\n uint256 chainId,\n address requester\n ) external view returns (bool isBlocked);\n\n function airnodeToDepositorToFreezeStatus(\n address airnode,\n address depositor\n ) external view returns (bool isFrozen);\n}\n" + }, + "contracts/authorizers/interfaces/IRequesterAuthorizerWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../access-control-registry/interfaces/IAccessControlRegistryAdminnedWithManager.sol\";\nimport \"./IRequesterAuthorizer.sol\";\n\ninterface IRequesterAuthorizerWithManager is\n IAccessControlRegistryAdminnedWithManager,\n IRequesterAuthorizer\n{\n function authorizationExpirationExtenderRole()\n external\n view\n returns (bytes32);\n\n function authorizationExpirationSetterRole()\n external\n view\n returns (bytes32);\n\n function indefiniteAuthorizerRole() external view returns (bytes32);\n}\n" + }, + "contracts/authorizers/mock/MockErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\ncontract MockErc721 is ERC721 {\n constructor() ERC721(\"Token\", \"TKN\") {\n for (uint256 tokenId = 0; tokenId < 10; tokenId++) {\n _mint(msg.sender, tokenId);\n }\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizer.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IRequesterAuthorizer.sol\";\n\n/// @title Abstract contract that temporarily or indefinitely authorizes\n/// requesters for Airnodes\n/// @dev Airnodes can be configured to use multiple Authorizers, and one of\n/// them returning `true` means the request should be responded to. The Airnode\n/// operator is expected to communicate the required information to the users\n/// through off-chain channels.\nabstract contract RequesterAuthorizer is IRequesterAuthorizer {\n struct AuthorizationStatus {\n uint32 expirationTimestamp;\n uint224 indefiniteAuthorizationCount;\n }\n\n /// @notice Authorization expiration extender role description\n string\n public constant\n override AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION =\n \"Authorization expiration extender\";\n\n /// @notice Authorization expiration setter role description\n string\n public constant\n override AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION =\n \"Authorization expiration setter\";\n\n /// @notice Indefinite authorizer role description\n string public constant override INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION =\n \"Indefinite authorizer\";\n\n mapping(address => mapping(address => AuthorizationStatus))\n public\n override airnodeToRequesterToAuthorizationStatus;\n\n mapping(address => mapping(address => mapping(address => bool)))\n public\n override airnodeToRequesterToSetterToIndefiniteAuthorizationStatus;\n\n /// @notice Extends the expiration of the temporary authorization of\n /// the requester` for the Airnode\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function _extendAuthorizationExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) internal {\n require(airnode != address(0), \"Airnode address zero\");\n require(requester != address(0), \"Requester address zero\");\n require(\n expirationTimestamp >\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .expirationTimestamp,\n \"Does not extend expiration\"\n );\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .expirationTimestamp = expirationTimestamp;\n emit ExtendedAuthorizationExpiration(\n airnode,\n requester,\n expirationTimestamp,\n msg.sender\n );\n }\n\n /// @notice Sets the expiration of the temporary authorization of\n /// the requester for the Airnode\n /// @dev Unlike `_extendAuthorizerExpiration()`, this can hasten expiration\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function _setAuthorizationExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) internal {\n require(airnode != address(0), \"Airnode address zero\");\n require(requester != address(0), \"Requester address zero\");\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .expirationTimestamp = expirationTimestamp;\n emit SetAuthorizationExpiration(\n airnode,\n requester,\n expirationTimestamp,\n msg.sender\n );\n }\n\n /// @notice Sets the indefinite authorization status of the requester for\n /// the Airnode\n /// @dev Emits the event even if it does not change the state\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param status Indefinite authorization status\n function _setIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n bool status\n ) internal {\n require(airnode != address(0), \"Airnode address zero\");\n require(requester != address(0), \"Requester address zero\");\n uint224 indefiniteAuthorizationCount = airnodeToRequesterToAuthorizationStatus[\n airnode\n ][requester].indefiniteAuthorizationCount;\n if (\n status &&\n !airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][msg.sender]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][msg.sender] = true;\n unchecked {\n indefiniteAuthorizationCount++;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n } else if (\n !status &&\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][msg.sender]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][msg.sender] = false;\n unchecked {\n indefiniteAuthorizationCount--;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n }\n emit SetIndefiniteAuthorizationStatus(\n airnode,\n requester,\n status,\n indefiniteAuthorizationCount,\n msg.sender\n );\n }\n\n /// @notice Revokes the indefinite authorization status granted to the\n /// requester for the Airnode by a specific account\n /// @dev Only emits the event if it changes the state\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param setter Setter of the indefinite authorization status\n function _revokeIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n address setter\n ) internal {\n require(airnode != address(0), \"Airnode address zero\");\n require(requester != address(0), \"Requester address zero\");\n require(setter != address(0), \"Setter address zero\");\n uint224 indefiniteAuthorizationCount = airnodeToRequesterToAuthorizationStatus[\n airnode\n ][requester].indefiniteAuthorizationCount;\n if (\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][setter]\n ) {\n airnodeToRequesterToSetterToIndefiniteAuthorizationStatus[airnode][\n requester\n ][setter] = false;\n unchecked {\n indefiniteAuthorizationCount--;\n }\n airnodeToRequesterToAuthorizationStatus[airnode][requester]\n .indefiniteAuthorizationCount = indefiniteAuthorizationCount;\n emit RevokedIndefiniteAuthorizationStatus(\n airnode,\n requester,\n setter,\n indefiniteAuthorizationCount,\n msg.sender\n );\n }\n }\n\n /// @notice Verifies the authorization status of the requester for the\n /// Airnode\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @return Authorization status of the request\n function isAuthorized(\n address airnode,\n address requester\n ) public view override returns (bool) {\n AuthorizationStatus\n storage authorizationStatus = airnodeToRequesterToAuthorizationStatus[\n airnode\n ][requester];\n return\n authorizationStatus.indefiniteAuthorizationCount > 0 ||\n authorizationStatus.expirationTimestamp > block.timestamp;\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithAirnode.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminned.sol\";\nimport \"./RequesterAuthorizer.sol\";\nimport \"./interfaces/IRequesterAuthorizerWithAirnode.sol\";\n\n/// @title Authorizer contract that Airnode operators can use to temporarily or\n/// indefinitely authorize requesters for the respective Airnodes\ncontract RequesterAuthorizerWithAirnode is\n AccessControlRegistryAdminned,\n RequesterAuthorizer,\n IRequesterAuthorizerWithAirnode\n{\n bytes32\n private constant AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION_HASH =\n keccak256(\n abi.encodePacked(AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION)\n );\n\n bytes32\n private constant AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION_HASH =\n keccak256(\n abi.encodePacked(AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION)\n );\n\n bytes32 private constant INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION_HASH =\n keccak256(abi.encodePacked(INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION));\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription\n )\n AccessControlRegistryAdminned(\n _accessControlRegistry,\n _adminRoleDescription\n )\n {}\n\n /// @notice Extends the expiration of the temporary authorization of\n /// `requester` for `airnode` if the sender is allowed to extend\n /// authorization expiration\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function extendAuthorizerExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasAuthorizationExpirationExtenderRoleOrIsAirnode(\n airnode,\n msg.sender\n ),\n \"Cannot extend expiration\"\n );\n _extendAuthorizationExpiration(airnode, requester, expirationTimestamp);\n }\n\n /// @notice Sets the expiration of the temporary authorization of\n /// `requester` for `airnode` if the sender is allowed to set expiration\n /// @dev Unlike `extendAuthorizerExpiration()`, this can hasten expiration\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function setAuthorizationExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasAuthorizationExpirationSetterRoleOrIsAirnode(\n airnode,\n msg.sender\n ),\n \"Cannot set expiration\"\n );\n _setAuthorizationExpiration(airnode, requester, expirationTimestamp);\n }\n\n /// @notice Sets the indefinite authorization status of `requester` for\n /// `airnode` if the sender is allowed to authorize indefinitely\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param status Indefinite authorization status\n function setIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n bool status\n ) external override {\n require(\n hasIndefiniteAuthorizerRoleOrIsAirnode(airnode, msg.sender),\n \"Cannot set indefinite status\"\n );\n _setIndefiniteAuthorizationStatus(airnode, requester, status);\n }\n\n /// @notice Revokes the indefinite authorization status granted by a\n /// specific account that no longer has the indefinite authorizer role\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param setter Setter of the indefinite authorization status\n function revokeIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n address setter\n ) external override {\n require(\n !hasIndefiniteAuthorizerRoleOrIsAirnode(airnode, setter),\n \"setter can set indefinite status\"\n );\n _revokeIndefiniteAuthorizationStatus(airnode, requester, setter);\n }\n\n /// @notice Derives the admin role for the Airnode\n /// @param airnode Airnode address\n /// @return adminRole Admin role\n function deriveAdminRole(\n address airnode\n ) external view override returns (bytes32 adminRole) {\n adminRole = _deriveAdminRole(airnode);\n }\n\n /// @notice Derives the authorization expiration extender role for the\n /// Airnode\n /// @param airnode Airnode address\n /// @return authorizationExpirationExtenderRole Authorization expiration\n /// extender role\n function deriveAuthorizationExpirationExtenderRole(\n address airnode\n )\n public\n view\n override\n returns (bytes32 authorizationExpirationExtenderRole)\n {\n authorizationExpirationExtenderRole = _deriveRole(\n _deriveAdminRole(airnode),\n AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION_HASH\n );\n }\n\n /// @notice Derives the authorization expiration setter role for the\n /// Airnode\n /// @param airnode Airnode address\n /// @return authorizationExpirationSetterRole Authorization expiration\n /// setter role\n function deriveAuthorizationExpirationSetterRole(\n address airnode\n ) public view override returns (bytes32 authorizationExpirationSetterRole) {\n authorizationExpirationSetterRole = _deriveRole(\n _deriveAdminRole(airnode),\n AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION_HASH\n );\n }\n\n /// @notice Derives the indefinite authorizer role for the Airnode\n /// @param airnode Airnode address\n /// @return indefiniteAuthorizerRole Indefinite authorizer role\n function deriveIndefiniteAuthorizerRole(\n address airnode\n ) public view override returns (bytes32 indefiniteAuthorizerRole) {\n indefiniteAuthorizerRole = _deriveRole(\n _deriveAdminRole(airnode),\n INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION_HASH\n );\n }\n\n /// @dev Returns if the account has the authorization expiration extender\n /// role or is the Airnode address\n /// @param airnode Airnode address\n /// @param account Account address\n /// @return If the account has the authorization extender role or is the\n /// Airnode address\n function hasAuthorizationExpirationExtenderRoleOrIsAirnode(\n address airnode,\n address account\n ) private view returns (bool) {\n return\n airnode == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveAuthorizationExpirationExtenderRole(airnode),\n account\n );\n }\n\n /// @dev Returns if the account has the authorization expriation setter\n /// role or is the Airnode address\n /// @param airnode Airnode address\n /// @param account Account address\n /// @return If the account has the authorization expiration setter role or\n /// is the Airnode address\n function hasAuthorizationExpirationSetterRoleOrIsAirnode(\n address airnode,\n address account\n ) private view returns (bool) {\n return\n airnode == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveAuthorizationExpirationSetterRole(airnode),\n account\n );\n }\n\n /// @dev Returns if the account has the indefinite authorizer role or is\n /// the Airnode address\n /// @param airnode Airnode address\n /// @param account Account address\n /// @return If the account has the indefinite authorizer role or is the\n /// Airnode addrss\n function hasIndefiniteAuthorizerRoleOrIsAirnode(\n address airnode,\n address account\n ) private view returns (bool) {\n return\n airnode == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveIndefiniteAuthorizerRole(airnode),\n account\n );\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithErc721.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminned.sol\";\nimport \"./interfaces/IRequesterAuthorizerWithErc721.sol\";\nimport \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\n/// @title Authorizer contract that users can deposit the ERC721 tokens\n/// recognized by the Airnode to receive authorization for the requester\n/// contract on the chain\n/// @notice For an Airnode to treat an ERC721 token deposit as a valid reason\n/// for the respective requester contract to be authorized, it needs to be\n/// configured at deploy-time to (1) use this contract as an authorizer,\n/// (2) recognize the respectice ERC721 token contract.\n/// It can be expected for Airnodes to be configured to only recognize the\n/// respective NFT keys that their operators have issued, but this is not\n/// necessarily true, i.e., an Airnode can be configured to recognize an\n/// arbitrary ERC721 token.\n/// This contract allows Airnodes to block specific requester contracts. It can\n/// be expected for Airnodes to only do this when the requester is breaking\n/// T&C. The tokens that have been deposited to authorize requesters that have\n/// been blocked can be revoked, which transfers them to the Airnode account.\n/// This can be seen as a staking/slashing mechanism. Accordingly, users should\n/// not deposit ERC721 tokens to receive authorization from Airnodes that they\n/// suspect may abuse this mechanic.\n/// @dev Airnode operators are strongly recommended to only use a single\n/// instance of this contract as an authorizer. If multiple instances are used,\n/// the state between the instances should be kept consistent. For example, if\n/// a requester on a chain is to be blocked, all instances of this contract\n/// that are used as authorizers for the chain should be updated. Otherwise,\n/// the requester to be blocked can still be authorized via the instances that\n/// have not been updated.\ncontract RequesterAuthorizerWithErc721 is\n AccessControlRegistryAdminned,\n IRequesterAuthorizerWithErc721\n{\n struct TokenDeposits {\n uint256 count;\n mapping(address => Deposit) depositorToDeposit;\n }\n\n struct Deposit {\n uint256 tokenId;\n uint32 withdrawalLeadTime;\n uint32 earliestWithdrawalTime;\n DepositState state;\n }\n\n /// @notice Withdrawal lead time setter role description\n string\n public constant\n override WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION =\n \"Withdrawal lead time setter\";\n /// @notice Requester blocker role description\n string public constant override REQUESTER_BLOCKER_ROLE_DESCRIPTION =\n \"Requester blocker\";\n /// @notice Depositor freezer role description\n string public constant override DEPOSITOR_FREEZER_ROLE_DESCRIPTION =\n \"Depositor freezer\";\n\n bytes32 private constant WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION_HASH =\n keccak256(\n abi.encodePacked(WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION)\n );\n bytes32 private constant REQUESTER_BLOCKER_ROLE_DESCRIPTION_HASH =\n keccak256(abi.encodePacked(REQUESTER_BLOCKER_ROLE_DESCRIPTION));\n bytes32 private constant DEPOSITOR_FREEZER_ROLE_DESCRIPTION_HASH =\n keccak256(abi.encodePacked(DEPOSITOR_FREEZER_ROLE_DESCRIPTION));\n\n /// @notice Deposits of the token with the address made for the Airnode to\n /// authorize the requester address on the chain\n mapping(address => mapping(uint256 => mapping(address => mapping(address => TokenDeposits))))\n public\n override airnodeToChainIdToRequesterToTokenAddressToTokenDeposits;\n\n /// @notice Withdrawal lead time of the Airnode. This creates the window of\n /// opportunity during which a requester can be blocked for breaking T&C\n /// and the respective token can be revoked.\n /// The withdrawal lead time at deposit-time will apply to a specific\n /// deposit.\n mapping(address => uint32) public override airnodeToWithdrawalLeadTime;\n\n /// @notice If the Airnode has blocked the requester on the chain. In the\n /// context of the respective Airnode, no one can deposit for a blocked\n /// requester, make deposit updates that relate to a blocked requester, or\n /// withdraw a token deposited for a blocked requester. Anyone can revoke\n /// tokens that are already deposited for a blocked requester. Existing\n /// deposits for a blocked requester do not provide authorization.\n mapping(address => mapping(uint256 => mapping(address => bool)))\n public\n override airnodeToChainIdToRequesterToBlockStatus;\n\n /// @notice If the Airnode has frozen the depositor. In the context of the\n /// respective Airnode, a frozen depositor cannot deposit, make deposit\n /// updates or withdraw.\n mapping(address => mapping(address => bool))\n public\n override airnodeToDepositorToFreezeStatus;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription\n )\n AccessControlRegistryAdminned(\n _accessControlRegistry,\n _adminRoleDescription\n )\n {}\n\n /// @notice Called by the Airnode or its withdrawal lead time setters to\n /// set withdrawal lead time\n /// @param airnode Airnode address\n /// @param withdrawalLeadTime Withdrawal lead time\n function setWithdrawalLeadTime(\n address airnode,\n uint32 withdrawalLeadTime\n ) external override {\n require(\n airnode == msg.sender ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveWithdrawalLeadTimeSetterRole(airnode),\n msg.sender\n ),\n \"Sender cannot set lead time\"\n );\n require(withdrawalLeadTime <= 30 days, \"Lead time too long\");\n airnodeToWithdrawalLeadTime[airnode] = withdrawalLeadTime;\n emit SetWithdrawalLeadTime(airnode, withdrawalLeadTime, msg.sender);\n }\n\n /// @notice Called by the Airnode or its requester blockers to set\n /// the block status of the requester\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param status Block status\n function setRequesterBlockStatus(\n address airnode,\n uint256 chainId,\n address requester,\n bool status\n ) external override {\n require(\n airnode == msg.sender ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveRequesterBlockerRole(airnode),\n msg.sender\n ),\n \"Sender cannot block requester\"\n );\n require(chainId != 0, \"Chain ID zero\");\n require(requester != address(0), \"Requester address zero\");\n airnodeToChainIdToRequesterToBlockStatus[airnode][chainId][\n requester\n ] = status;\n emit SetRequesterBlockStatus(\n airnode,\n requester,\n chainId,\n status,\n msg.sender\n );\n }\n\n /// @notice Called by the Airnode or its depositor freezers to set the\n /// freeze status of the depositor\n /// @param airnode Airnode address\n /// @param depositor Depositor address\n /// @param status Freeze status\n function setDepositorFreezeStatus(\n address airnode,\n address depositor,\n bool status\n ) external override {\n require(\n airnode == msg.sender ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n deriveDepositorFreezerRole(airnode),\n msg.sender\n ),\n \"Sender cannot freeze depositor\"\n );\n require(depositor != address(0), \"Depositor address zero\");\n airnodeToDepositorToFreezeStatus[airnode][depositor] = status;\n emit SetDepositorFreezeStatus(airnode, depositor, status, msg.sender);\n }\n\n /// @notice Called by the ERC721 contract upon `safeTransferFrom()` to this\n /// contract to deposit a token to authorize the requester\n /// @dev The first argument is the operator, which we do not need\n /// @param _from Account from which the token is transferred\n /// @param _tokenId Token ID\n /// @param _data Airnode address, chain ID and requester address in\n /// ABI-encoded form\n /// @return `onERC721Received()` function selector\n function onERC721Received(\n address,\n address _from,\n uint256 _tokenId,\n bytes calldata _data\n ) external override returns (bytes4) {\n require(_data.length == 96, \"Unexpected data length\");\n (address airnode, uint256 chainId, address requester) = abi.decode(\n _data,\n (address, uint256, address)\n );\n require(airnode != address(0), \"Airnode address zero\");\n require(chainId != 0, \"Chain ID zero\");\n require(requester != address(0), \"Requester address zero\");\n require(\n !airnodeToChainIdToRequesterToBlockStatus[airnode][chainId][\n requester\n ],\n \"Requester blocked\"\n );\n require(\n !airnodeToDepositorToFreezeStatus[airnode][_from],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][msg.sender];\n uint256 tokenDepositCount;\n unchecked {\n tokenDepositCount = ++tokenDeposits.count;\n }\n require(\n tokenDeposits.depositorToDeposit[_from].state ==\n DepositState.Inactive,\n \"Token already deposited\"\n );\n tokenDeposits.depositorToDeposit[_from] = Deposit({\n tokenId: _tokenId,\n withdrawalLeadTime: airnodeToWithdrawalLeadTime[airnode],\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n emit DepositedToken(\n airnode,\n requester,\n _from,\n chainId,\n msg.sender,\n _tokenId,\n tokenDepositCount\n );\n return this.onERC721Received.selector;\n }\n\n /// @notice Called by a token depositor to update the requester for which\n /// they have deposited the token for\n /// @dev This is especially useful for not having to wait when the Airnode\n /// has set a non-zero withdrawal lead time\n /// @param airnode Airnode address\n /// @param chainIdPrevious Previous chain ID\n /// @param requesterPrevious Previous requester address\n /// @param chainIdNext Next chain ID\n /// @param requesterNext Next requester address\n /// @param token Token address\n function updateDepositRequester(\n address airnode,\n uint256 chainIdPrevious,\n address requesterPrevious,\n uint256 chainIdNext,\n address requesterNext,\n address token\n ) external override {\n require(chainIdNext != 0, \"Chain ID zero\");\n require(requesterNext != address(0), \"Requester address zero\");\n require(\n !(chainIdPrevious == chainIdNext &&\n requesterPrevious == requesterNext),\n \"Does not update requester\"\n );\n require(\n !airnodeToChainIdToRequesterToBlockStatus[airnode][chainIdPrevious][\n requesterPrevious\n ],\n \"Previous requester blocked\"\n );\n require(\n !airnodeToChainIdToRequesterToBlockStatus[airnode][chainIdNext][\n requesterNext\n ],\n \"Next requester blocked\"\n );\n require(\n !airnodeToDepositorToFreezeStatus[airnode][msg.sender],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage requesterPreviousTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdPrevious][requesterPrevious][token];\n Deposit\n storage requesterPreviousDeposit = requesterPreviousTokenDeposits\n .depositorToDeposit[msg.sender];\n if (requesterPreviousDeposit.state != DepositState.Active) {\n if (requesterPreviousDeposit.state == DepositState.Inactive) {\n revert(\"Token not deposited\");\n } else {\n revert(\"Withdrawal initiated\");\n }\n }\n TokenDeposits\n storage requesterNextTokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainIdNext][requesterNext][token];\n require(\n requesterNextTokenDeposits.depositorToDeposit[msg.sender].state ==\n DepositState.Inactive,\n \"Token already deposited\"\n );\n uint256 requesterNextTokenDepositCount = ++requesterNextTokenDeposits\n .count;\n requesterNextTokenDeposits.count = requesterNextTokenDepositCount;\n uint256 requesterPreviousTokenDepositCount = --requesterPreviousTokenDeposits\n .count;\n requesterPreviousTokenDeposits\n .count = requesterPreviousTokenDepositCount;\n uint256 tokenId = requesterPreviousDeposit.tokenId;\n requesterNextTokenDeposits.depositorToDeposit[msg.sender] = Deposit({\n tokenId: tokenId,\n withdrawalLeadTime: requesterPreviousDeposit.withdrawalLeadTime,\n earliestWithdrawalTime: 0,\n state: DepositState.Active\n });\n requesterPreviousTokenDeposits.depositorToDeposit[\n msg.sender\n ] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit UpdatedDepositRequesterTo(\n airnode,\n requesterNext,\n msg.sender,\n chainIdNext,\n token,\n tokenId,\n requesterNextTokenDepositCount\n );\n emit UpdatedDepositRequesterFrom(\n airnode,\n requesterPrevious,\n msg.sender,\n chainIdPrevious,\n token,\n tokenId,\n requesterPreviousTokenDepositCount\n );\n }\n\n /// @notice Called by a token depositor to initiate withdrawal\n /// @dev The depositor is allowed to initiate a withdrawal even if the\n /// respective requester is blocked. However, the withdrawal will not be\n /// executable as long as the requester is blocked.\n /// Token withdrawals can be initiated even if withdrawal lead time is\n /// zero.\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param token Token address\n /// @return earliestWithdrawalTime Earliest withdrawal time\n function initiateTokenWithdrawal(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external override returns (uint32 earliestWithdrawalTime) {\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[msg.sender];\n if (deposit.state != DepositState.Active) {\n if (deposit.state == DepositState.Inactive) {\n revert(\"Token not deposited\");\n } else {\n revert(\"Withdrawal already initiated\");\n }\n }\n uint256 tokenDepositCount;\n unchecked {\n tokenDepositCount = --tokenDeposits.count;\n }\n earliestWithdrawalTime = SafeCast.toUint32(\n block.timestamp + deposit.withdrawalLeadTime\n );\n deposit.earliestWithdrawalTime = earliestWithdrawalTime;\n deposit.state = DepositState.WithdrawalInitiated;\n emit InitiatedTokenWithdrawal(\n airnode,\n requester,\n msg.sender,\n chainId,\n token,\n deposit.tokenId,\n earliestWithdrawalTime,\n tokenDepositCount\n );\n }\n\n /// @notice Called by a token depositor to withdraw\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param token Token address\n function withdrawToken(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external override {\n require(\n !airnodeToChainIdToRequesterToBlockStatus[airnode][chainId][\n requester\n ],\n \"Requester blocked\"\n );\n require(\n !airnodeToDepositorToFreezeStatus[airnode][msg.sender],\n \"Depositor frozen\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[msg.sender];\n require(deposit.state != DepositState.Inactive, \"Token not deposited\");\n uint256 tokenDepositCount;\n if (deposit.state == DepositState.Active) {\n require(\n deposit.withdrawalLeadTime == 0,\n \"Withdrawal not initiated\"\n );\n unchecked {\n tokenDepositCount = --tokenDeposits.count;\n }\n } else {\n require(\n block.timestamp >= deposit.earliestWithdrawalTime,\n \"Cannot withdraw yet\"\n );\n unchecked {\n tokenDepositCount = tokenDeposits.count;\n }\n }\n uint256 tokenId = deposit.tokenId;\n tokenDeposits.depositorToDeposit[msg.sender] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit WithdrewToken(\n airnode,\n requester,\n msg.sender,\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), msg.sender, tokenId);\n }\n\n /// @notice Called to revoke the token deposited to authorize a requester\n /// that is blocked now\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param token Token address\n /// @param depositor Depositor address\n function revokeToken(\n address airnode,\n uint256 chainId,\n address requester,\n address token,\n address depositor\n ) external override {\n require(\n airnodeToChainIdToRequesterToBlockStatus[airnode][chainId][\n requester\n ],\n \"Airnode did not block requester\"\n );\n TokenDeposits\n storage tokenDeposits = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token];\n Deposit storage deposit = tokenDeposits.depositorToDeposit[depositor];\n require(deposit.state != DepositState.Inactive, \"Token not deposited\");\n uint256 tokenDepositCount;\n if (deposit.state == DepositState.Active) {\n unchecked {\n tokenDepositCount = --tokenDeposits.count;\n }\n } else {\n unchecked {\n tokenDepositCount = tokenDeposits.count;\n }\n }\n uint256 tokenId = deposit.tokenId;\n tokenDeposits.depositorToDeposit[depositor] = Deposit({\n tokenId: 0,\n withdrawalLeadTime: 0,\n earliestWithdrawalTime: 0,\n state: DepositState.Inactive\n });\n emit RevokedToken(\n airnode,\n requester,\n depositor,\n chainId,\n token,\n tokenId,\n tokenDepositCount\n );\n IERC721(token).safeTransferFrom(address(this), airnode, tokenId);\n }\n\n /// @notice Returns the deposit of the token with the address made by the\n /// depositor for the Airnode to authorize the requester address on the\n /// chain\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param token Token address\n /// @param depositor Depositor address\n /// @return tokenId Token ID\n /// @return withdrawalLeadTime Withdrawal lead time captured at\n /// deposit-time\n /// @return earliestWithdrawalTime Earliest withdrawal time\n function airnodeToChainIdToRequesterToTokenToDepositorToDeposit(\n address airnode,\n uint256 chainId,\n address requester,\n address token,\n address depositor\n )\n external\n view\n override\n returns (\n uint256 tokenId,\n uint32 withdrawalLeadTime,\n uint32 earliestWithdrawalTime,\n DepositState state\n )\n {\n Deposit\n storage deposit = airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[\n airnode\n ][chainId][requester][token].depositorToDeposit[depositor];\n (tokenId, withdrawalLeadTime, earliestWithdrawalTime, state) = (\n deposit.tokenId,\n deposit.withdrawalLeadTime,\n deposit.earliestWithdrawalTime,\n deposit.state\n );\n }\n\n /// @notice Returns if the requester on the chain is authorized for the\n /// Airnode due to a token with the address being deposited\n /// @param airnode Airnode address\n /// @param chainId Chain ID\n /// @param requester Requester address\n /// @param token Token address\n /// @return Authorization status\n function isAuthorized(\n address airnode,\n uint256 chainId,\n address requester,\n address token\n ) external view override returns (bool) {\n return\n !airnodeToChainIdToRequesterToBlockStatus[airnode][chainId][\n requester\n ] &&\n airnodeToChainIdToRequesterToTokenAddressToTokenDeposits[airnode][\n chainId\n ][requester][token].count >\n 0;\n }\n\n /// @notice Derives the withdrawal lead time setter role for the Airnode\n /// @param airnode Airnode address\n /// @return withdrawalLeadTimeSetterRole Withdrawal lead time setter role\n function deriveWithdrawalLeadTimeSetterRole(\n address airnode\n ) public view override returns (bytes32 withdrawalLeadTimeSetterRole) {\n withdrawalLeadTimeSetterRole = _deriveRole(\n _deriveAdminRole(airnode),\n WITHDRAWAL_LEAD_TIME_SETTER_ROLE_DESCRIPTION_HASH\n );\n }\n\n /// @notice Derives the requester blocker role for the Airnode\n /// @param airnode Airnode address\n /// @return requesterBlockerRole Requester blocker role\n function deriveRequesterBlockerRole(\n address airnode\n ) public view override returns (bytes32 requesterBlockerRole) {\n requesterBlockerRole = _deriveRole(\n _deriveAdminRole(airnode),\n REQUESTER_BLOCKER_ROLE_DESCRIPTION_HASH\n );\n }\n\n /// @notice Derives the depositor freezer role for the Airnode\n /// @param airnode Airnode address\n /// @return depositorFreezerRole Depositor freezer role\n function deriveDepositorFreezerRole(\n address airnode\n ) public view override returns (bytes32 depositorFreezerRole) {\n depositorFreezerRole = _deriveRole(\n _deriveAdminRole(airnode),\n DEPOSITOR_FREEZER_ROLE_DESCRIPTION_HASH\n );\n }\n}\n" + }, + "contracts/authorizers/RequesterAuthorizerWithManager.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./RequesterAuthorizer.sol\";\nimport \"./interfaces/IRequesterAuthorizerWithManager.sol\";\n\n/// @title Authorizer contract that the manager can use to temporarily or\n/// indefinitely authorize requesters for Airnodes\ncontract RequesterAuthorizerWithManager is\n AccessControlRegistryAdminnedWithManager,\n RequesterAuthorizer,\n IRequesterAuthorizerWithManager\n{\n /// @notice Authorization expiration extender role\n bytes32 public immutable override authorizationExpirationExtenderRole;\n\n /// @notice Authorization expiration setter role\n bytes32 public immutable override authorizationExpirationSetterRole;\n\n /// @notice Indefinite authorizer role\n bytes32 public immutable override indefiniteAuthorizerRole;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n authorizationExpirationExtenderRole = _deriveRole(\n adminRole,\n keccak256(\n abi.encodePacked(\n AUTHORIZATION_EXPIRATION_EXTENDER_ROLE_DESCRIPTION\n )\n )\n );\n authorizationExpirationSetterRole = _deriveRole(\n adminRole,\n keccak256(\n abi.encodePacked(\n AUTHORIZATION_EXPIRATION_SETTER_ROLE_DESCRIPTION\n )\n )\n );\n indefiniteAuthorizerRole = _deriveRole(\n adminRole,\n keccak256(abi.encodePacked(INDEFINITE_AUTHORIZER_ROLE_DESCRIPTION))\n );\n }\n\n /// @notice Extends the expiration of the temporary authoriztion of the\n /// requester for the Airnode if the sender is allowed to extend\n /// authorization expiration\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function extendAuthorizerExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasAuthorizationExpirationExtenderRoleOrIsManager(msg.sender),\n \"Cannot extend expiration\"\n );\n _extendAuthorizationExpiration(airnode, requester, expirationTimestamp);\n }\n\n /// @notice Sets the expiration of the temporary authorization of the\n /// requester for the Airnode if the sender is allowed to set expiration\n /// @dev Unlike `extendAuthorizerExpiration()`, this can hasten expiration\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param expirationTimestamp Timestamp at which the temporary\n /// authorization will expire\n function setAuthorizationExpiration(\n address airnode,\n address requester,\n uint32 expirationTimestamp\n ) external override {\n require(\n hasAuthorizationExpirationSetterRoleOrIsManager(msg.sender),\n \"Cannot set expiration\"\n );\n _setAuthorizationExpiration(airnode, requester, expirationTimestamp);\n }\n\n /// @notice Sets the indefinite authorizer status of the requester for the\n /// Airnode if the sender is allowed to authorize indefinitely\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param status Indefinite authorizer status\n function setIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n bool status\n ) external override {\n require(\n hasIndefiniteAuthorizerRoleOrIsManager(msg.sender),\n \"Cannot set indefinite status\"\n );\n _setIndefiniteAuthorizationStatus(airnode, requester, status);\n }\n\n /// @notice Revokes the indefinite authorization status granted by a\n /// specific account that no longer has the indefinite authorizer role\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param setter Setter of the indefinite authorization status\n function revokeIndefiniteAuthorizationStatus(\n address airnode,\n address requester,\n address setter\n ) external override {\n require(\n !hasIndefiniteAuthorizerRoleOrIsManager(setter),\n \"setter can set indefinite status\"\n );\n _revokeIndefiniteAuthorizationStatus(airnode, requester, setter);\n }\n\n /// @dev Returns if the account has the authorization expiration extender\n /// role or is the manager\n /// @param account Account address\n /// @return If the account has the authorization extender role or is the\n /// manager\n function hasAuthorizationExpirationExtenderRoleOrIsManager(\n address account\n ) private view returns (bool) {\n return\n manager == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n authorizationExpirationExtenderRole,\n account\n );\n }\n\n /// @dev Returns if the account has the authorization expiration setter\n /// role or is the manager\n /// @param account Account address\n /// @return If the account has the authorization expiration setter role or\n /// is the manager\n function hasAuthorizationExpirationSetterRoleOrIsManager(\n address account\n ) private view returns (bool) {\n return\n manager == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n authorizationExpirationSetterRole,\n account\n );\n }\n\n /// @dev Returns if the account has the indefinite authorizer role or is\n /// the manager\n /// @param account Account address\n /// @return If the account has the indefinite authorizer role or is the\n /// manager\n function hasIndefiniteAuthorizerRoleOrIsManager(\n address account\n ) private view returns (bool) {\n return\n manager == account ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n indefiniteAuthorizerRole,\n account\n );\n }\n}\n" + }, + "contracts/protocol/AirnodeProtocol.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"../utils/ExtendedSelfMulticall.sol\";\nimport \"./StorageUtils.sol\";\nimport \"./SponsorshipUtils.sol\";\nimport \"./WithdrawalUtils.sol\";\nimport \"./interfaces/IAirnodeProtocol.sol\";\n\n/// @title Airnode request–response protocol (RRP) and its relayed version\n/// @notice Similar to HTTP, RRP allows the requester to specify a one-off\n/// request that the Airnode is expected to respond to as soon as possible.\n/// The relayed version allows the requester to specify an Airnode that will\n/// sign the fulfillment data and a relayer that will report the signed\n/// fulfillment.\n/// @dev StorageUtils, SponsorshipUtils and WithdrawalUtils also implement some\n/// auxiliary functionality for PSP\ncontract AirnodeProtocol is\n ExtendedSelfMulticall,\n StorageUtils,\n SponsorshipUtils,\n WithdrawalUtils,\n IAirnodeProtocol\n{\n using ECDSA for bytes32;\n\n /// @notice Number of requests the requester has made\n mapping(address => uint256) public override requesterToRequestCount;\n\n mapping(bytes32 => bytes32) private requestIdToFulfillmentParameters;\n\n /// @notice Called by the requester to make a request\n /// @dev It is the responsibility of the respective Airnode to resolve if\n /// `endpointOrTemplateId` is an endpoint ID or a template ID\n /// @param endpointOrTemplateId Endpoint or template ID\n /// @param parameters Parameters\n /// @param sponsor Sponsor address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @return requestId Request ID\n function makeRequest(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external override returns (bytes32 requestId) {\n require(airnode != address(0), \"Airnode address zero\");\n require(\n endpointOrTemplateId != bytes32(0),\n \"Endpoint or template ID zero\"\n );\n require(\n parameters.length <= MAXIMUM_PARAMETER_LENGTH,\n \"Parameters too long\"\n );\n require(sponsor != address(0), \"Sponsor address zero\");\n require(fulfillFunctionId != bytes4(0), \"Fulfill function ID zero\");\n uint256 requesterRequestCount = ++requesterToRequestCount[msg.sender];\n requestId = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n requesterRequestCount,\n airnode,\n endpointOrTemplateId,\n parameters,\n sponsor,\n fulfillFunctionId\n )\n );\n requestIdToFulfillmentParameters[requestId] = keccak256(\n abi.encodePacked(airnode, msg.sender, fulfillFunctionId)\n );\n emit MadeRequest(\n airnode,\n requestId,\n msg.sender,\n requesterRequestCount,\n endpointOrTemplateId,\n parameters,\n sponsor,\n fulfillFunctionId\n );\n }\n\n /// @notice Called by the Airnode using the sponsor wallet to fulfill the\n /// request\n /// @dev Airnodes attest to controlling their respective sponsor wallets by\n /// signing a message with the address of the sponsor wallet. A timestamp\n /// is added to this signature for it to act as an expiring token if the\n /// requester contract checks for freshness.\n /// This will not revert depending on the external call. However, it will\n /// return `false` if the external call reverts or if there is no function\n /// with a matching signature at `fulfillAddress`. On the other hand, it\n /// will return `true` if the external call returns successfully or if\n /// there is no contract deployed at `fulfillAddress`.\n /// If `callSuccess` is `false`, `callData` can be decoded to retrieve the\n /// revert string.\n /// @param requestId Request ID\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data, encoded in contract ABI\n /// @param signature Request ID, a timestamp and the sponsor wallet address\n /// signed by the Airnode wallet\n /// @return callSuccess If the fulfillment call succeeded\n /// @return callData Data returned by the fulfillment call (if there is\n /// any)\n function fulfillRequest(\n bytes32 requestId,\n address airnode,\n address requester,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override returns (bool callSuccess, bytes memory callData) {\n require(\n keccak256(\n abi.encodePacked(airnode, requester, fulfillFunctionId)\n ) == requestIdToFulfillmentParameters[requestId],\n \"Invalid request fulfillment\"\n );\n require(\n (\n keccak256(abi.encodePacked(requestId, timestamp, msg.sender))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n delete requestIdToFulfillmentParameters[requestId];\n // solhint-disable-next-line avoid-low-level-calls\n (callSuccess, callData) = requester.call(\n abi.encodeWithSelector(\n fulfillFunctionId,\n requestId,\n timestamp,\n data\n )\n );\n if (callSuccess) {\n emit FulfilledRequest(airnode, requestId, timestamp, data);\n } else {\n // We do not bubble up the revert string from `callData`\n emit FailedRequest(\n airnode,\n requestId,\n timestamp,\n \"Fulfillment failed unexpectedly\"\n );\n }\n }\n\n /// @notice Called by the Airnode using the sponsor wallet if the request\n /// cannot be fulfilled\n /// @dev The Airnode should fall back to this if a request cannot be\n /// fulfilled because of an error, including the static call to `fulfill()`\n /// returning `false` for `callSuccess`\n /// @param requestId Request ID\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @param timestamp Timestamp used in the signature\n /// @param errorMessage A message that explains why the request has failed\n /// @param signature Request ID, a timestamp and the sponsor wallet address\n /// signed by the Airnode address\n function failRequest(\n bytes32 requestId,\n address airnode,\n address requester,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n string calldata errorMessage,\n bytes calldata signature\n ) external override {\n require(\n keccak256(\n abi.encodePacked(airnode, requester, fulfillFunctionId)\n ) == requestIdToFulfillmentParameters[requestId],\n \"Invalid request fulfillment\"\n );\n require(\n (\n keccak256(abi.encodePacked(requestId, timestamp, msg.sender))\n .toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n delete requestIdToFulfillmentParameters[requestId];\n emit FailedRequest(airnode, requestId, timestamp, errorMessage);\n }\n\n /// @notice Called by the requester to make a request to be fulfilled by a\n /// relayer\n /// @dev The relayer address is indexed in the relayed protocol logs\n /// because it will be the relayer that will be listening to these logs\n /// @param endpointOrTemplateId Endpoint or template ID\n /// @param parameters Parameters\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @return requestId Request ID\n function makeRequestRelayed(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address relayer,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external override returns (bytes32 requestId) {\n require(airnode != address(0), \"Airnode address zero\");\n require(\n endpointOrTemplateId != bytes32(0),\n \"Endpoint or template ID zero\"\n );\n require(\n parameters.length <= MAXIMUM_PARAMETER_LENGTH,\n \"Parameters too long\"\n );\n require(relayer != address(0), \"Relayer address zero\");\n require(sponsor != address(0), \"Sponsor address zero\");\n require(fulfillFunctionId != bytes4(0), \"Fulfill function ID zero\");\n uint256 requesterRequestCount = ++requesterToRequestCount[msg.sender];\n requestId = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n requesterRequestCount,\n airnode,\n endpointOrTemplateId,\n parameters,\n relayer,\n sponsor,\n fulfillFunctionId\n )\n );\n requestIdToFulfillmentParameters[requestId] = keccak256(\n abi.encodePacked(airnode, msg.sender, relayer, fulfillFunctionId)\n );\n emit MadeRequestRelayed(\n relayer,\n requestId,\n airnode,\n msg.sender,\n requesterRequestCount,\n endpointOrTemplateId,\n parameters,\n sponsor,\n fulfillFunctionId\n );\n }\n\n /// @notice Called by the relayer using the sponsor wallet to fulfill the\n /// request with the Airnode-signed response\n /// @dev The Airnode must verify the integrity of the request details,\n /// template details, sponsor address–sponsor wallet address consistency\n /// before signing the response\n /// @param requestId Request ID\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param relayer Relayer address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @param timestamp Timestamp used in the signature\n /// @param data Fulfillment data\n /// @param signature Request ID, a timestamp, the sponsor wallet address\n /// and the fulfillment data signed by the Airnode address\n /// @return callSuccess If the fulfillment call succeeded\n /// @return callData Data returned by the fulfillment call (if there is\n /// any)\n function fulfillRequestRelayed(\n bytes32 requestId,\n address airnode,\n address requester,\n address relayer,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external override returns (bool callSuccess, bytes memory callData) {\n require(\n keccak256(\n abi.encodePacked(airnode, requester, relayer, fulfillFunctionId)\n ) == requestIdToFulfillmentParameters[requestId],\n \"Invalid request fulfillment\"\n );\n require(\n (\n keccak256(\n abi.encodePacked(requestId, timestamp, msg.sender, data)\n ).toEthSignedMessageHash()\n ).recover(signature) == airnode,\n \"Signature mismatch\"\n );\n delete requestIdToFulfillmentParameters[requestId];\n // solhint-disable-next-line avoid-low-level-calls\n (callSuccess, callData) = requester.call(\n abi.encodeWithSelector(\n fulfillFunctionId,\n requestId,\n timestamp,\n data\n )\n );\n if (callSuccess) {\n emit FulfilledRequestRelayed(\n relayer,\n requestId,\n airnode,\n timestamp,\n data\n );\n } else {\n // We do not bubble up the revert string from `callData`\n emit FailedRequestRelayed(\n relayer,\n requestId,\n airnode,\n timestamp,\n \"Fulfillment failed unexpectedly\"\n );\n }\n }\n\n /// @notice Called by the relayer using the sponsor wallet if the request\n /// cannot be fulfilled\n /// @dev Since failure may also include problems at the Airnode-end (such\n /// as it being unavailable), we are content with a signature from the\n /// relayer to validate failures. This is acceptable because explicit\n /// failures are mainly for easy debugging of issues, and the requester\n /// should always consider denial of service from a relayer or an Airnode\n /// to be a possibility.\n /// @param requestId Request ID\n /// @param airnode Airnode address\n /// @param requester Requester address\n /// @param relayer Relayer address\n /// @param timestamp Timestamp used in the signature\n /// @param errorMessage A message that explains why the request has failed\n /// @param signature Request ID, a timestamp and the sponsor wallet address\n /// signed by the relayer address\n function failRequestRelayed(\n bytes32 requestId,\n address airnode,\n address requester,\n address relayer,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n string calldata errorMessage,\n bytes calldata signature\n ) external override {\n require(\n keccak256(\n abi.encodePacked(airnode, requester, relayer, fulfillFunctionId)\n ) == requestIdToFulfillmentParameters[requestId],\n \"Invalid request fulfillment\"\n );\n require(\n (\n keccak256(abi.encodePacked(requestId, timestamp, msg.sender))\n .toEthSignedMessageHash()\n ).recover(signature) == relayer,\n \"Signature mismatch\"\n );\n delete requestIdToFulfillmentParameters[requestId];\n emit FailedRequestRelayed(\n relayer,\n requestId,\n airnode,\n timestamp,\n errorMessage\n );\n }\n\n /// @notice Returns if the request with the ID is made but not\n /// fulfilled/failed yet\n /// @dev If a requester has made a request, received a request ID but did\n /// not hear back, it can call this method to check if the Airnode/relayer\n /// called back `failRequest()`/`failRequestRelayed()` instead.\n /// @param requestId Request ID\n /// @return If the request is awaiting fulfillment\n function requestIsAwaitingFulfillment(\n bytes32 requestId\n ) external view override returns (bool) {\n return requestIdToFulfillmentParameters[requestId] != bytes32(0);\n }\n}\n" + }, + "contracts/protocol/AirnodeRequester.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IAirnodeProtocol.sol\";\nimport \"./interfaces/IAirnodeRequester.sol\";\n\n/// @title Contract to be inherited by contracts that will make Airnode\n/// requests and receive fulfillments\nabstract contract AirnodeRequester is IAirnodeRequester {\n /// @notice AirnodeProtocol contract address\n address public immutable override airnodeProtocol;\n\n /// @dev Reverts if the sender is not the AirnodeProtocol contract. Use\n /// this modifier with methods that are meant to receive RRP fulfillments.\n modifier onlyAirnodeProtocol() {\n require(\n msg.sender == address(airnodeProtocol),\n \"Sender not Airnode protocol\"\n );\n _;\n }\n\n /// @dev Reverts if the timestamp is not valid. Use this modifier with\n /// methods that are meant to receive RRP and PSP fulfillments.\n /// @param timestamp Timestamp used in the signature\n modifier onlyValidTimestamp(uint256 timestamp) {\n require(timestampIsValid(timestamp), \"Timestamp not valid\");\n _;\n }\n\n /// @param _airnodeProtocol AirnodeProtocol contract address\n constructor(address _airnodeProtocol) {\n require(_airnodeProtocol != address(0), \"AirnodeProtocol address zero\");\n airnodeProtocol = _airnodeProtocol;\n }\n\n /// @notice Overriden by the inheriting contract to return if the timestamp\n /// used in the signature is valid\n /// @dev If and how the timestamp should be validated depends on the nature\n /// of the request. If the request is \"return me the price of this asset at\n /// this specific time in history\", it can be assumed that the response\n /// will not go out of date. If the request is \"return me the price of this\n /// asset now\", the requester would rather not consider a response that is\n /// not immediate.\n /// In addition to the nature of the request, if and how the timestamp is\n /// used in the contract logic determines how it should be validated.\n /// In general, one should keep in mind that similar to the fulfillment\n /// data, it is possible for the timestamp to be misreported.\n /// @param timestamp Timestamp used in the signature\n function timestampIsValid(\n uint256 timestamp\n ) internal view virtual returns (bool);\n}\n" + }, + "contracts/protocol/interfaces/IAirnodeProtocol.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../../utils/interfaces/IExtendedSelfMulticall.sol\";\nimport \"./IStorageUtils.sol\";\nimport \"./ISponsorshipUtils.sol\";\nimport \"./IWithdrawalUtils.sol\";\n\ninterface IAirnodeProtocol is\n IExtendedSelfMulticall,\n IStorageUtils,\n ISponsorshipUtils,\n IWithdrawalUtils\n{\n event MadeRequest(\n address indexed airnode,\n bytes32 indexed requestId,\n address requester,\n uint256 requesterRequestCount,\n bytes32 endpointOrTemplateId,\n bytes parameters,\n address sponsor,\n bytes4 fulfillFunctionId\n );\n\n event FulfilledRequest(\n address indexed airnode,\n bytes32 indexed requestId,\n uint256 timestamp,\n bytes data\n );\n\n event FailedRequest(\n address indexed airnode,\n bytes32 indexed requestId,\n uint256 timestamp,\n string errorMessage\n );\n\n event MadeRequestRelayed(\n address indexed relayer,\n bytes32 indexed requestId,\n address indexed airnode,\n address requester,\n uint256 requesterRequestCount,\n bytes32 endpointOrTemplateId,\n bytes parameters,\n address sponsor,\n bytes4 fulfillFunctionId\n );\n\n event FulfilledRequestRelayed(\n address indexed relayer,\n bytes32 indexed requestId,\n address indexed airnode,\n uint256 timestamp,\n bytes data\n );\n\n event FailedRequestRelayed(\n address indexed relayer,\n bytes32 indexed requestId,\n address indexed airnode,\n uint256 timestamp,\n string errorMessage\n );\n\n function makeRequest(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external returns (bytes32 requestId);\n\n function fulfillRequest(\n bytes32 requestId,\n address airnode,\n address requester,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external returns (bool callSuccess, bytes memory callData);\n\n function failRequest(\n bytes32 requestId,\n address airnode,\n address requester,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n string calldata errorMessage,\n bytes calldata signature\n ) external;\n\n function makeRequestRelayed(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address relayer,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external returns (bytes32 requestId);\n\n function fulfillRequestRelayed(\n bytes32 requestId,\n address airnode,\n address requester,\n address relayer,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n bytes calldata data,\n bytes calldata signature\n ) external returns (bool callSuccess, bytes memory callData);\n\n function failRequestRelayed(\n bytes32 requestId,\n address airnode,\n address requester,\n address relayer,\n bytes4 fulfillFunctionId,\n uint256 timestamp,\n string calldata errorMessage,\n bytes calldata signature\n ) external;\n\n function requestIsAwaitingFulfillment(\n bytes32 requestId\n ) external view returns (bool);\n\n function requesterToRequestCount(\n address requester\n ) external view returns (uint256);\n}\n" + }, + "contracts/protocol/interfaces/IAirnodeRequester.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IAirnodeRequester {\n function airnodeProtocol() external view returns (address);\n}\n" + }, + "contracts/protocol/interfaces/ISponsorshipUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ISponsorshipUtils {\n event SetRrpSponsorshipStatus(\n address indexed sponsor,\n address indexed requester,\n bool status\n );\n\n event SetPspSponsorshipStatus(\n address indexed sponsor,\n bytes32 indexed subscriptionId,\n bool status\n );\n\n function setRrpSponsorshipStatus(address requester, bool status) external;\n\n function setPspSponsorshipStatus(\n bytes32 subscriptionId,\n bool status\n ) external;\n\n function sponsorToRequesterToRrpSponsorshipStatus(\n address sponsor,\n address requester\n ) external view returns (bool status);\n\n function sponsorToSubscriptionIdToPspSponsorshipStatus(\n address sponsor,\n bytes32 subscriptionId\n ) external view returns (bool status);\n}\n" + }, + "contracts/protocol/interfaces/IStorageUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IStorageUtils {\n event StoredTemplate(\n bytes32 indexed templateId,\n bytes32 endpointId,\n bytes parameters\n );\n\n event StoredSubscription(\n bytes32 indexed subscriptionId,\n uint256 chainId,\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes parameters,\n bytes conditions,\n address relayer,\n address sponsor,\n address requester,\n bytes4 fulfillFunctionId\n );\n\n function storeTemplate(\n bytes32 endpointId,\n bytes calldata parameters\n ) external returns (bytes32 templateId);\n\n function storeSubscription(\n uint256 chainId,\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n bytes calldata conditions,\n address relayer,\n address sponsor,\n address requester,\n bytes4 fulfillFunctionId\n ) external returns (bytes32 subscriptionId);\n\n // solhint-disable-next-line func-name-mixedcase\n function MAXIMUM_PARAMETER_LENGTH() external view returns (uint256);\n\n function templates(\n bytes32 templateId\n ) external view returns (bytes32 endpointId, bytes memory parameters);\n\n function subscriptions(\n bytes32 subscriptionId\n )\n external\n view\n returns (\n uint256 chainId,\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes memory parameters,\n bytes memory conditions,\n address relayer,\n address sponsor,\n address requester,\n bytes4 fulfillFunctionId\n );\n}\n" + }, + "contracts/protocol/interfaces/IWithdrawalUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IWithdrawalUtils {\n event RequestedWithdrawal(\n address indexed airnodeOrRelayer,\n address indexed sponsor,\n bytes32 indexed withdrawalRequestId,\n uint256 protocolId\n );\n\n event FulfilledWithdrawal(\n address indexed airnodeOrRelayer,\n address indexed sponsor,\n bytes32 indexed withdrawalRequestId,\n uint256 protocolId,\n address sponsorWallet,\n uint256 amount\n );\n\n event ClaimedBalance(address indexed sponsor, uint256 amount);\n\n function requestWithdrawal(\n address airnodeOrRelayer,\n uint256 protocolId\n ) external;\n\n function fulfillWithdrawal(\n bytes32 withdrawalRequestId,\n address airnodeOrRelayer,\n uint256 protocolId,\n address sponsor,\n uint256 timestamp,\n bytes calldata signature\n ) external payable;\n\n function claimBalance() external;\n\n function withdrawalRequestIsAwaitingFulfillment(\n bytes32 withdrawalRequestId\n ) external view returns (bool);\n\n function sponsorToBalance(address sponsor) external view returns (uint256);\n\n function sponsorToWithdrawalRequestCount(\n address sponsor\n ) external view returns (uint256);\n}\n" + }, + "contracts/protocol/mock/MockAirnodeRequester.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../AirnodeRequester.sol\";\n\ncontract MockAirnodeRequester is AirnodeRequester {\n mapping(bytes32 => bytes) public requestIdToData;\n\n constructor(address _airnodeProtocol) AirnodeRequester(_airnodeProtocol) {}\n\n function makeRequest(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external returns (bytes32 requestId) {\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequest(\n airnode,\n endpointOrTemplateId,\n parameters,\n sponsor,\n fulfillFunctionId\n );\n }\n\n function makeRequestRelayed(\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n address relayer,\n address sponsor,\n bytes4 fulfillFunctionId\n ) external returns (bytes32 requestId) {\n requestId = IAirnodeProtocol(airnodeProtocol).makeRequestRelayed(\n airnode,\n endpointOrTemplateId,\n parameters,\n relayer,\n sponsor,\n fulfillFunctionId\n );\n }\n\n function fulfillRequest(\n bytes32 requestId,\n uint256 timestamp,\n bytes calldata data\n ) external onlyAirnodeProtocol onlyValidTimestamp(timestamp) {\n requestIdToData[requestId] = data;\n }\n\n /// @notice A method to be called back by the respective method at\n /// AirnodeRrp.sol for testing fulfillment failure\n /// @param // requestId Request ID\n /// @param timestamp Timestamp used in the signature\n /// @param // data Data returned by the Airnode\n function fulfillRequestAlwaysReverts(\n bytes32 /* requestId */,\n uint256 timestamp,\n bytes calldata /* data */\n ) external view onlyAirnodeProtocol onlyValidTimestamp(timestamp) {\n revert(\"Always reverts\");\n }\n\n /// @notice A method to be called back by the respective method at\n /// AirnodeRrp.sol for testing fulfillment failure\n /// @param // requestId Request ID\n /// @param timestamp Timestamp used in the signature\n /// @param // data Data returned by the Airnode\n function fulfillRequestAlwaysRevertsWithNoString(\n bytes32 /* requestId */,\n uint256 timestamp,\n bytes calldata /* data */\n ) external view onlyAirnodeProtocol onlyValidTimestamp(timestamp) {\n revert(); // solhint-disable-line reason-string\n }\n\n /// @notice A method to be called back by the respective method at\n /// AirnodeRrp.sol for testing fulfillment running out of gas\n /// @param // requestId Request ID\n /// @param timestamp Timestamp used in the signature\n /// @param // data Data returned by the Airnode\n function fulfillRequestAlwaysRunsOutOfGas(\n bytes32 /* requestId */,\n uint256 timestamp,\n bytes calldata /* data */\n ) external view onlyAirnodeProtocol onlyValidTimestamp(timestamp) {\n while (true) {}\n }\n\n /// @notice Overriden to reject signatures that have been signed 1 hour\n /// before or after `block.timestamp`\n /// @dev The validation scheme implemented here is an arbitrary example. Do\n /// not treat it as a recommendation. Refer to AirnodeRequester for more\n /// information.\n /// @param timestamp Timestamp used in the signature\n function timestampIsValid(\n uint256 timestamp\n ) internal view virtual override returns (bool) {\n return\n timestamp + 1 hours > block.timestamp &&\n timestamp < block.timestamp + 1 hours;\n }\n}\n" + }, + "contracts/protocol/mock/MockSponsor.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../AirnodeRequester.sol\";\n\ncontract MockSponsor is AirnodeRequester {\n constructor(address _airnodeProtocol) AirnodeRequester(_airnodeProtocol) {}\n\n function requestWithdrawal(\n address airnodeOrRelayer,\n uint256 protocolId\n ) external {\n IAirnodeProtocol(airnodeProtocol).requestWithdrawal(\n airnodeOrRelayer,\n protocolId\n );\n }\n\n function claimBalance() external {\n IAirnodeProtocol(airnodeProtocol).claimBalance();\n }\n\n function timestampIsValid(\n uint256\n ) internal view virtual override returns (bool) {\n return true;\n }\n}\n" + }, + "contracts/protocol/SponsorshipUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./interfaces/ISponsorshipUtils.sol\";\n\n/// @title Contract that sponsors can use to announce their willingness to\n/// sponsor a particular RRP requester or PSP subscription\n/// @notice The sponsorship status is not checked during requests or\n/// fulfillments, which means the respective Airnode is trusted to make this\n/// check through a static call to this contract. The Airnode may skip this\n/// check if it has received an off-chain assurance.\n/// @dev An Airnode (or relayer) has a \"sponsor wallet\" dedicated for each\n/// account through an HD wallet. When a requester makes a request specifying a\n/// sponsor, the Airnode verifies the sponsorship my making a static call to\n/// this contract, and uses the respective sponsor wallet to fulfill the\n/// request. This allows the sponsor to cover the gas costs of the\n/// fulfillments, as they know that funds they have deposited in the respective\n/// sponsor wallet will only be used for use-cases they have sponsored.\ncontract SponsorshipUtils is ISponsorshipUtils {\n /// @notice Sponsorship status for a sponsor–RRP requester pair\n mapping(address => mapping(address => bool))\n public\n override sponsorToRequesterToRrpSponsorshipStatus;\n\n /// @notice Sponsorship status for a sponsor–PSP subscription pair\n mapping(address => mapping(bytes32 => bool))\n public\n override sponsorToSubscriptionIdToPspSponsorshipStatus;\n\n /// @notice Called by the sponsor to set the sponsorship status of an RRP\n /// requester\n /// @dev This applies to both regular and relayed RRP requests\n /// @param requester RRP requester address\n /// @param status Sponsorship status\n function setRrpSponsorshipStatus(\n address requester,\n bool status\n ) external override {\n require(requester != address(0), \"Requester address zero\");\n sponsorToRequesterToRrpSponsorshipStatus[msg.sender][\n requester\n ] = status;\n emit SetRrpSponsorshipStatus(msg.sender, requester, status);\n }\n\n /// @notice Called by the sponsor to set the sponsorship status of a PSP\n /// subscription\n /// @param subscriptionId Subscription ID\n /// @param status Sponsorship status\n function setPspSponsorshipStatus(\n bytes32 subscriptionId,\n bool status\n ) external override {\n require(subscriptionId != bytes32(0), \"Subscription ID zero\");\n sponsorToSubscriptionIdToPspSponsorshipStatus[msg.sender][\n subscriptionId\n ] = status;\n emit SetPspSponsorshipStatus(msg.sender, subscriptionId, status);\n }\n}\n" + }, + "contracts/protocol/StorageUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"./interfaces/IStorageUtils.sol\";\n\n/// @title Contract that stores template and subscription details on chain\n/// @notice The Airnode protocol does not depend on the template or\n/// subscription details being stored on-chain. Airnode can be informed about\n/// these in other ways, e.g., the details are hardcoded in the Airnode\n/// configuration file.\ncontract StorageUtils is IStorageUtils {\n struct Template {\n bytes32 endpointId;\n bytes parameters;\n }\n\n struct Subscription {\n uint256 chainId;\n address airnode;\n bytes32 endpointOrTemplateId;\n bytes parameters;\n bytes conditions;\n address relayer;\n address sponsor;\n address requester;\n bytes4 fulfillFunctionId;\n }\n\n /// @notice Maximum parameter length for byte strings that Airnodes will\n /// need to read from storage or logs\n /// @dev A very generous limit is applied, under the assumption that\n /// anything larger than this is a grief attempt. If the user needs to use\n /// longer parameters, they will need to use off-chain channels to pass\n /// the respective template/subscription details to the Airnode operator\n /// for them to be specified in the configuration file.\n uint256 public constant override MAXIMUM_PARAMETER_LENGTH = 4096;\n\n /// @notice Template details with the ID\n mapping(bytes32 => Template) public override templates;\n\n /// @notice Subscription details with the ID\n mapping(bytes32 => Subscription) public override subscriptions;\n\n /// @notice Stores template details\n /// @dev Templates fully or partially define requests. By referencing a\n /// template, requesters can omit specifying the \"boilerplate\" sections of\n /// requests.\n /// In a subscription context, a zero endpoint ID means the Airnode does\n /// not need to use one of its endpoints, and can move directly on to\n /// fulfillment. This is particularly useful for defining traditional\n /// keeper jobs that do not require off-chain data.\n /// @param endpointId Endpoint ID (allowed to be `bytes32(0)`)\n /// @param parameters Template parameters, encoded in Airnode ABI\n /// @return templateId Template ID\n function storeTemplate(\n bytes32 endpointId,\n bytes calldata parameters\n ) external override returns (bytes32 templateId) {\n require(\n parameters.length <= MAXIMUM_PARAMETER_LENGTH,\n \"Parameters too long\"\n );\n templateId = keccak256(abi.encodePacked(endpointId, parameters));\n templates[templateId] = Template({\n endpointId: endpointId,\n parameters: parameters\n });\n emit StoredTemplate(templateId, endpointId, parameters);\n }\n\n /// @notice Stores subscription details\n /// @dev `airnode` should make the query specified by `templateId` and\n /// `parameters`. If the returned data satisfies `conditions`, it should\n /// call `requester`'s `fulfillFunctionId` on `chainId` with the returned\n /// data, using the wallet dedicated to `sponsor`.\n /// If `relayer` is not `airnode`, the relayer is responsible with checking\n /// `condition` and using the wallet dedicated to `sponsor` to deliver the\n /// data.\n /// In most cases, `conditions` will specify a static call to a function on\n /// `chainId` with the data. The extent of its flexibility depends on the\n /// node implementation and is outside the scope of the on-chain protocol.\n /// Similarly, `conditions` can specify with what frequency it should be\n /// verified, and the details of this is outside the scope.\n /// `templateId` being zero is similar to the endpoint ID being zero for\n /// templates, means the endpoint query can be skipped. In this case,\n /// `parameters` will be treated as the data that is returned by the\n /// endpoint while verifying `conditions`.\n /// @param chainId Chain ID\n /// @param airnode Airnode address\n /// @param endpointOrTemplateId Endpoint or template ID (allowed to be\n /// `bytes32(0)`)\n /// @param parameters Parameters provided by the subscription in addition\n /// to the parameters in the template (if applicable), encoded in Airnode\n /// ABI\n /// @param conditions Conditions under which the subscription is requested\n /// to be fulfilled, encoded in Airnode ABI\n /// @param relayer Relayer address\n /// @param sponsor Sponsor address\n /// @param requester Requester address\n /// @param fulfillFunctionId Selector of the function to be called for\n /// fulfillment\n /// @return subscriptionId Subscription ID\n function storeSubscription(\n uint256 chainId,\n address airnode,\n bytes32 endpointOrTemplateId,\n bytes calldata parameters,\n bytes calldata conditions,\n address relayer,\n address sponsor,\n address requester,\n bytes4 fulfillFunctionId\n ) external override returns (bytes32 subscriptionId) {\n require(chainId != 0, \"Chain ID zero\");\n require(airnode != address(0), \"Airnode address zero\");\n require(\n parameters.length <= MAXIMUM_PARAMETER_LENGTH,\n \"Parameters too long\"\n );\n require(\n conditions.length <= MAXIMUM_PARAMETER_LENGTH,\n \"Conditions too long\"\n );\n require(relayer != address(0), \"Relayer address zero\");\n require(sponsor != address(0), \"Sponsor address zero\");\n require(requester != address(0), \"Requester address zero\");\n require(fulfillFunctionId != bytes4(0), \"Fulfill function ID zero\");\n subscriptionId = keccak256(\n abi.encode(\n chainId,\n airnode,\n endpointOrTemplateId,\n parameters,\n conditions,\n relayer,\n sponsor,\n requester,\n fulfillFunctionId\n )\n );\n subscriptions[subscriptionId] = Subscription({\n chainId: chainId,\n airnode: airnode,\n endpointOrTemplateId: endpointOrTemplateId,\n parameters: parameters,\n conditions: conditions,\n relayer: relayer,\n sponsor: sponsor,\n requester: requester,\n fulfillFunctionId: fulfillFunctionId\n });\n emit StoredSubscription(\n subscriptionId,\n chainId,\n airnode,\n endpointOrTemplateId,\n parameters,\n conditions,\n relayer,\n sponsor,\n requester,\n fulfillFunctionId\n );\n }\n}\n" + }, + "contracts/protocol/WithdrawalUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"./interfaces/IWithdrawalUtils.sol\";\n\n/// @title Contract that can be used by sponsors to request withdrawals from\n/// sponsor wallets and Airnodes/relayers to fulfill these\n/// @notice The respective Airnode/relayer may not support withdrawals for the\n/// specified protocol, or at all. Similarly, an Airnode/relayer may deposit\n/// funds directly to the sponsor address without being prompted, e.g., because\n/// they are ceasing operations. In general, no guarantee is provided for the\n/// funds deposited to sponsor wallets at the protocol level. Therefore, the\n/// sponsors should limit their deposits to the minimum amount required for\n/// their operations, and assume they will not receive these funds back.\n/// @dev Withdrawals are implemented in the form of pull payments. The sponsor\n/// requests a withdrawal from a sponsor wallet, and the Airnode/relayer uses\n/// the specified sponsor wallet to deposit the entire balance at this\n/// contract. Then, the sponsor claims/pulls the payment from this contract.\n/// Different protocols (RRP, PSP, etc.) use different sponsor wallets for a\n/// particular Airnode/relayer–sponsor pair, which is why sponsor wallet\n/// derivation includes a protocol ID. Refer to the node documentation for what\n/// these protocol IDs are.\ncontract WithdrawalUtils is IWithdrawalUtils {\n using ECDSA for bytes32;\n\n /// @notice Sponsor balance that is withdrawn but not claimed\n mapping(address => uint256) public override sponsorToBalance;\n\n /// @notice Number of withdrawal requests the sponsor made\n mapping(address => uint256) public override sponsorToWithdrawalRequestCount;\n\n mapping(bytes32 => bytes32) private withdrawalRequestIdToParameters;\n\n /// @notice Called by a sponsor to request a withdrawal. In response, the\n /// Airnode/relayer is expected to deposit the funds at this contract by\n /// calling `fulfillWithdrawal()`, and then the sponsor will have to call\n /// `claimBalance()` to have the funds sent to itself. For sponsor to be\n /// able to receive funds this way, it has to be an EOA or a contract that\n /// has an appropriate payable fallback function.\n /// @param airnodeOrRelayer Airnode/relayer address\n /// @param protocolId Protocol ID\n function requestWithdrawal(\n address airnodeOrRelayer,\n uint256 protocolId\n ) external override {\n require(airnodeOrRelayer != address(0), \"Airnode/relayer address zero\");\n require(protocolId != 0, \"Protocol ID zero\");\n bytes32 withdrawalRequestId = keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n msg.sender,\n ++sponsorToWithdrawalRequestCount[msg.sender]\n )\n );\n withdrawalRequestIdToParameters[withdrawalRequestId] = keccak256(\n abi.encodePacked(airnodeOrRelayer, protocolId, msg.sender)\n );\n emit RequestedWithdrawal(\n airnodeOrRelayer,\n msg.sender,\n withdrawalRequestId,\n protocolId\n );\n }\n\n /// @notice Called by the Airnode/relayer using the sponsor wallet to\n /// fulfill the withdrawal request made by the sponsor\n /// @param withdrawalRequestId Withdrawal request ID\n /// @param airnodeOrRelayer Airnode/relayer address\n /// @param protocolId Protocol ID\n /// @param sponsor Sponsor address\n function fulfillWithdrawal(\n bytes32 withdrawalRequestId,\n address airnodeOrRelayer,\n uint256 protocolId,\n address sponsor,\n uint256 timestamp,\n bytes calldata signature\n ) external payable override {\n require(\n withdrawalRequestIdToParameters[withdrawalRequestId] ==\n keccak256(\n abi.encodePacked(airnodeOrRelayer, protocolId, sponsor)\n ),\n \"Invalid withdrawal fulfillment\"\n );\n unchecked {\n require(\n timestamp + 1 hours > block.timestamp &&\n timestamp < block.timestamp + 1 hours,\n \"Timestamp not valid\"\n );\n }\n require(\n (\n keccak256(\n abi.encodePacked(withdrawalRequestId, timestamp, msg.sender)\n ).toEthSignedMessageHash()\n ).recover(signature) == airnodeOrRelayer,\n \"Signature mismatch\"\n );\n delete withdrawalRequestIdToParameters[withdrawalRequestId];\n sponsorToBalance[sponsor] += msg.value;\n emit FulfilledWithdrawal(\n airnodeOrRelayer,\n sponsor,\n withdrawalRequestId,\n protocolId,\n msg.sender,\n msg.value\n );\n }\n\n /// @notice Called by the sponsor to claim the withdrawn funds\n /// @dev The sponsor must be able to receive funds. For example, if the\n /// sponsor is a contract without a default `payable` function, this will\n /// revert.\n function claimBalance() external override {\n uint256 sponsorBalance = sponsorToBalance[msg.sender];\n require(sponsorBalance != 0, \"Sender balance zero\");\n sponsorToBalance[msg.sender] = 0;\n emit ClaimedBalance(msg.sender, sponsorBalance);\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, ) = msg.sender.call{value: sponsorBalance}(\"\");\n require(success, \"Transfer failed\");\n }\n\n /// @notice Returns if the withdrawal request with the ID is made but not\n /// fulfilled yet\n /// @param withdrawalRequestId Withdrawal request ID\n /// @return isAwaitingFulfillment If the withdrawal request is awaiting\n /// fulfillment\n function withdrawalRequestIsAwaitingFulfillment(\n bytes32 withdrawalRequestId\n ) external view override returns (bool) {\n return\n withdrawalRequestIdToParameters[withdrawalRequestId] != bytes32(0);\n }\n}\n" + }, + "contracts/utils/ExtendedSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.7;\n\nimport \"./SelfMulticall.sol\";\nimport \"./interfaces/IExtendedSelfMulticall.sol\";\n\n/// @title Contract that extends SelfMulticall to fetch some of the global\n/// variables\n/// @notice Available global variables are limited to the ones that Airnode\n/// tends to need\ncontract ExtendedSelfMulticall is SelfMulticall, IExtendedSelfMulticall {\n /// @notice Returns the chain ID\n /// @return Chain ID\n function getChainId() external view override returns (uint256) {\n return block.chainid;\n }\n\n /// @notice Returns the account balance\n /// @param account Account address\n /// @return Account balance\n function getBalance(\n address account\n ) external view override returns (uint256) {\n return account.balance;\n }\n\n /// @notice Returns if the account contains bytecode\n /// @dev An account not containing any bytecode does not indicate that it\n /// is an EOA or it will not contain any bytecode in the future.\n /// Contract construction and `SELFDESTRUCT` updates the bytecode at the\n /// end of the transaction.\n /// @return If the account contains bytecode\n function containsBytecode(\n address account\n ) external view override returns (bool) {\n return account.code.length > 0;\n }\n\n /// @notice Returns the current block number\n /// @return Current block number\n function getBlockNumber() external view override returns (uint256) {\n return block.number;\n }\n\n /// @notice Returns the current block timestamp\n /// @return Current block timestamp\n function getBlockTimestamp() external view override returns (uint256) {\n return block.timestamp;\n }\n\n /// @notice Returns the current block basefee\n /// @return Current block basefee\n function getBlockBasefee() external view override returns (uint256) {\n return block.basefee;\n }\n}\n" + }, + "contracts/utils/ExternalMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/IExternalMulticall.sol\";\n\n/// @title Contract that enables calls to external contracts to be batched\n/// @notice This contract can be used for two use-cases: (1) In its current\n/// state, it can be used to batch static calls to contracts that do not care\n/// about who the sender is, (2) after extending it, to interact with trusted\n/// contracts (see below for details). It implements two ways of batching, one\n/// requires none of the calls to revert and the other tolerates individual\n/// calls reverting.\n/// @dev As mentioned above, this contract can be used to interact with trusted\n/// contracts. Such interactions can leave this contract in a privileged\n/// position (e.g., ExternalMulticall may be left with a non-zero balance of an\n/// ERC20 token as a result of a transaction sent to it), which can be abused\n/// by an attacker afterwards. In addition, attackers can frontrun interactions\n/// to have the following interaction result in an unintended outcome. A\n/// general solution to these attacks is overriding both multicall functions\n/// behind an access control mechanism, such as an `onlyOwner` modifier.\n/// Refer to MakerDAO's Multicall.sol for a similar implementation.\nabstract contract ExternalMulticall is IExternalMulticall {\n /// @notice Batches calls to external contracts and reverts as soon as one\n /// of the batched calls reverts\n /// @param targets Array of target addresses of batched calls\n /// @param data Array of calldata of batched calls\n /// @return returndata Array of returndata of batched calls\n function externalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n ) public virtual override returns (bytes[] memory returndata) {\n uint256 callCount = targets.length;\n require(callCount == data.length, \"Parameter length mismatch\");\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n require(\n targets[ind].code.length > 0,\n \"Multicall target not contract\"\n );\n bool success;\n // solhint-disable-next-line avoid-low-level-calls\n (success, returndata[ind]) = targets[ind].call(data[ind]);\n if (!success) {\n bytes memory returndataWithRevertData = returndata[ind];\n // Adapted from OpenZeppelin's Address.sol\n if (returndataWithRevertData.length > 0) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndataWithRevertData)\n revert(\n add(32, returndataWithRevertData),\n returndata_size\n )\n }\n } else {\n revert(\"Multicall: No revert string\");\n }\n }\n unchecked {\n ind++;\n }\n }\n }\n\n /// @notice Batches calls to external contracts but does not revert if any\n /// of the batched calls reverts\n /// @param targets Array of target addresses of batched calls\n /// @param data Array of calldata of batched calls\n /// @return successes Array of success conditions of batched calls\n /// @return returndata Array of returndata of batched calls\n function tryExternalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n )\n public\n virtual\n override\n returns (bool[] memory successes, bytes[] memory returndata)\n {\n uint256 callCount = targets.length;\n require(callCount == data.length, \"Parameter length mismatch\");\n successes = new bool[](callCount);\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n if (targets[ind].code.length > 0) {\n // solhint-disable-next-line avoid-low-level-calls\n (successes[ind], returndata[ind]) = targets[ind].call(\n data[ind]\n );\n } else {\n returndata[ind] = abi.encodeWithSignature(\n \"Error(string)\",\n \"Multicall target not contract\"\n );\n }\n unchecked {\n ind++;\n }\n }\n }\n}\n" + }, + "contracts/utils/interfaces/IExtendedSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./ISelfMulticall.sol\";\n\ninterface IExtendedSelfMulticall is ISelfMulticall {\n function getChainId() external view returns (uint256);\n\n function getBalance(address account) external view returns (uint256);\n\n function containsBytecode(address account) external view returns (bool);\n\n function getBlockNumber() external view returns (uint256);\n\n function getBlockTimestamp() external view returns (uint256);\n\n function getBlockBasefee() external view returns (uint256);\n}\n" + }, + "contracts/utils/interfaces/IExternalMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IExternalMulticall {\n function externalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n ) external returns (bytes[] memory returndata);\n\n function tryExternalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n ) external returns (bool[] memory success, bytes[] memory returndata);\n}\n" + }, + "contracts/utils/interfaces/IOevSearcherMulticallV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOevSearcherMulticallV1 {\n function externalMulticallWithValue(\n address[] calldata targets,\n bytes[] calldata data,\n uint256[] calldata values\n ) external payable returns (bytes[] memory returndata);\n}\n" + }, + "contracts/utils/interfaces/IOrderPayable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOrderPayable {\n event PaidForOrder(\n bytes32 indexed orderId,\n uint256 expirationTimestamp,\n address orderSigner,\n uint256 amount,\n address sender\n );\n\n event Withdrew(address recipient, uint256 amount);\n\n function payForOrder(bytes calldata encodedData) external payable;\n\n function withdraw(address recipient) external returns (uint256 amount);\n\n // solhint-disable-next-line func-name-mixedcase\n function ORDER_SIGNER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n // solhint-disable-next-line func-name-mixedcase\n function WITHDRAWER_ROLE_DESCRIPTION()\n external\n view\n returns (string memory);\n\n function orderSignerRole() external view returns (bytes32);\n\n function withdrawerRole() external view returns (bytes32);\n\n function orderIdToPaymentStatus(\n bytes32 orderId\n ) external view returns (bool paymentStatus);\n}\n" + }, + "contracts/utils/interfaces/IOwnableCallForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface IOwnableCallForwarder {\n function forwardCall(\n address forwardTarget,\n bytes calldata forwardedCalldata\n ) external payable returns (bytes memory returnedData);\n}\n" + }, + "contracts/utils/interfaces/ISelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ninterface ISelfMulticall {\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory returndata);\n\n function tryMulticall(\n bytes[] calldata data\n ) external returns (bool[] memory successes, bytes[] memory returndata);\n}\n" + }, + "contracts/utils/mock/MockCallForwarderTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract MockCallForwarderTarget {\n string public storage1;\n uint256 public storage2;\n\n function payableTargetFunction(\n string calldata input1,\n uint256 input2,\n uint256 msgValue\n ) external payable returns (bytes memory output1, bool output2) {\n require(\n keccak256(abi.encodePacked(input1)) ==\n keccak256(abi.encodePacked(\"input1\")),\n \"Incorrect input\"\n );\n require(input2 == 123, \"Incorrect input\");\n require(msg.value == msgValue, \"Incorrect value\");\n storage1 = input1;\n storage2 = input2;\n output1 = hex\"12345678\";\n output2 = true;\n }\n\n function nonpayableTargetFunction(\n string calldata input1,\n uint256 input2\n ) external returns (bytes memory output1, bool output2) {\n require(\n keccak256(abi.encodePacked(input1)) ==\n keccak256(abi.encodePacked(\"input1\")),\n \"Incorrect input\"\n );\n require(input2 == 123, \"Incorrect input\");\n storage1 = input1;\n storage2 = input2;\n output1 = hex\"12345678\";\n output2 = true;\n }\n}\n" + }, + "contracts/utils/mock/MockExternalMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"../ExternalMulticall.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\n// This contract overrides the multicall functions to demonstrate how they can\n// be extended to only allow the owner to execute multicalls. However, we\n// only do that in comments because we want to test the vanilla contract.\ncontract MockExternalMulticall is ExternalMulticall, Ownable {\n function externalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n ) public virtual override returns (bytes[] memory returndata) {\n // _checkOwner();\n return super.externalMulticall(targets, data);\n }\n\n function tryExternalMulticall(\n address[] calldata targets,\n bytes[] calldata data\n )\n public\n virtual\n override\n returns (bool[] memory successes, bytes[] memory returndata)\n {\n // _checkOwner();\n return super.tryExternalMulticall(targets, data);\n }\n}\n" + }, + "contracts/utils/mock/MockMulticallTarget.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ncontract MockMulticallTarget {\n error MyError(uint256 fieldAlways123, string fieldAlwaysFoo);\n\n int256[] private _argumentHistory;\n\n function alwaysRevertsWithString(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert(\"Reverted with string\");\n }\n\n function alwaysRevertsWithCustomError(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert MyError(123, \"Foo\");\n }\n\n function alwaysRevertsWithNoData(\n int256 argPositive,\n int256 argNegative\n ) external pure {\n require(argPositive > 0 && argNegative < 0, \"Invalid argument\");\n revert(); // solhint-disable-line reason-string\n }\n\n function convertsPositiveArgumentToNegative(\n int256 argPositive\n ) external payable returns (int256) {\n require(argPositive > 0, \"Argument not positive\");\n _argumentHistory.push(argPositive);\n return -argPositive;\n }\n\n function argumentHistory() external view returns (int256[] memory) {\n int256[] memory argumentHistoryInMemory = new int256[](\n _argumentHistory.length\n );\n for (uint256 ind = 0; ind < _argumentHistory.length; ind++) {\n argumentHistoryInMemory[ind] = _argumentHistory[ind];\n }\n return argumentHistoryInMemory;\n }\n}\n" + }, + "contracts/utils/mock/MockSelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport \"../SelfMulticall.sol\";\nimport \"./MockMulticallTarget.sol\";\n\ncontract MockSelfMulticall is SelfMulticall, MockMulticallTarget {}\n" + }, + "contracts/utils/OevSearcherMulticallV1.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"./interfaces/IOevSearcherMulticallV1.sol\";\n\n/// @title Contract that enables the owner OEV searcher to make batched calls\n/// to external, trusted accounts to facilitate value extraction\n/// @notice Any of the batched calls reverting will result in the transaction\n/// to be reverted. Batched calls are allowed to send values. The contract is\n/// allowed to receive funds in case this is required during value extraction.\n/// @dev OEV searchers that will be targeting the same contracts repeatedly are\n/// recommended to develop and use an optimized version of this contract\ncontract OevSearcherMulticallV1 is Ownable, IOevSearcherMulticallV1 {\n receive() external payable {}\n\n /// @notice Called by the owner OEV searcher to batch calls with value to\n /// external, trusted accounts. Any of these calls reverting causes this\n /// function to revert.\n /// @dev Calls made to non-contract accounts do not revert. This can be\n /// used to sweep the funds in the contract.\n /// @param targets Array of target addresses of batched calls\n /// @param data Array of calldata of batched calls\n /// @param values Array of values of batched calls\n /// @return returndata Array of returndata of batched calls\n function externalMulticallWithValue(\n address[] calldata targets,\n bytes[] calldata data,\n uint256[] calldata values\n ) external payable override onlyOwner returns (bytes[] memory returndata) {\n uint256 callCount = targets.length;\n require(\n callCount == data.length && callCount == values.length,\n \"Parameter length mismatch\"\n );\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n bool success;\n // solhint-disable-next-line avoid-low-level-calls\n (success, returndata[ind]) = targets[ind].call{value: values[ind]}(\n data[ind]\n );\n if (!success) {\n bytes memory returndataWithRevertData = returndata[ind];\n // Adapted from OpenZeppelin's Address.sol\n if (returndataWithRevertData.length > 0) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndataWithRevertData)\n revert(\n add(32, returndataWithRevertData),\n returndata_size\n )\n }\n } else {\n // Attempt to make sense of the silent revert after the\n // fact to optimize for the happy path\n require(\n address(this).balance >= values[ind],\n \"Multicall: Insufficient balance\"\n );\n revert(\"Multicall: No revert string\");\n }\n }\n unchecked {\n ind++;\n }\n }\n }\n}\n" + }, + "contracts/utils/OrderPayable.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"../access-control-registry/AccessControlRegistryAdminnedWithManager.sol\";\nimport \"./interfaces/IOrderPayable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/// @title Contract used to pay for orders denoted in the native currency\n/// @notice OrderPayable is managed by an account that designates order signers\n/// and withdrawers. Only orders for which a signature is issued for by an\n/// order signer can be paid for. Order signers have to be EOAs to be able to\n/// issue ERC191 signatures. The manager is responsible with reverting unwanted\n/// signatures (for example, if a compromised order signer issues an\n/// underpriced order and the order is paid for, the manager should revoke the\n/// role, refund the payment and consider the order void).\n/// Withdrawers can be EOAs or contracts. For example, one can implement a\n/// withdrawer contract that withdraws funds automatically to a Funder\n/// contract.\ncontract OrderPayable is\n AccessControlRegistryAdminnedWithManager,\n IOrderPayable\n{\n using ECDSA for bytes32;\n\n /// @notice Order signer role description\n string public constant override ORDER_SIGNER_ROLE_DESCRIPTION =\n \"Order signer\";\n\n /// @notice Withdrawer role description\n string public constant override WITHDRAWER_ROLE_DESCRIPTION = \"Withdrawer\";\n\n /// @notice Order signer role\n bytes32 public immutable override orderSignerRole;\n\n /// @notice Withdrawer role\n bytes32 public immutable override withdrawerRole;\n\n /// @notice Returns if the order with ID is paid for\n mapping(bytes32 => bool) public override orderIdToPaymentStatus;\n\n /// @param _accessControlRegistry AccessControlRegistry contract address\n /// @param _adminRoleDescription Admin role description\n /// @param _manager Manager address\n constructor(\n address _accessControlRegistry,\n string memory _adminRoleDescription,\n address _manager\n )\n AccessControlRegistryAdminnedWithManager(\n _accessControlRegistry,\n _adminRoleDescription,\n _manager\n )\n {\n orderSignerRole = _deriveRole(\n _deriveAdminRole(manager),\n ORDER_SIGNER_ROLE_DESCRIPTION\n );\n withdrawerRole = _deriveRole(\n _deriveAdminRole(manager),\n WITHDRAWER_ROLE_DESCRIPTION\n );\n }\n\n /// @notice Called with value to pay for an order\n /// @dev The sender must set `msg.value` to cover the exact amount\n /// specified by the order.\n /// Input arguments are provided in encoded form to improve the UX for\n /// using ABI-based, automatically generated contract GUIs such as ones\n /// from Safe and Etherscan. Given that OrderPayable is verified, the user\n /// is only required to provide the OrderPayable address, select\n /// `payForOrder()`, copy-paste `encodedData` (instead of 4 separate\n /// fields) and enter `msg.value`.\n /// @param encodedData The order ID, expiration timestamp, order signer\n /// address and signature in ABI-encoded form\n function payForOrder(bytes calldata encodedData) external payable override {\n // Do not care if `encodedData` has trailing data\n (\n bytes32 orderId,\n uint256 expirationTimestamp,\n address orderSigner,\n bytes memory signature\n ) = abi.decode(encodedData, (bytes32, uint256, address, bytes));\n // We do not allow invalid orders even if they are signed by an\n // authorized order signer\n require(orderId != bytes32(0), \"Order ID zero\");\n require(expirationTimestamp > block.timestamp, \"Order expired\");\n require(\n orderSigner == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n orderSignerRole,\n orderSigner\n ),\n \"Invalid order signer\"\n );\n require(msg.value > 0, \"Payment amount zero\");\n require(!orderIdToPaymentStatus[orderId], \"Order already paid for\");\n require(\n (\n keccak256(\n abi.encodePacked(\n block.chainid,\n address(this),\n orderId,\n expirationTimestamp,\n msg.value\n )\n ).toEthSignedMessageHash()\n ).recover(signature) == orderSigner,\n \"Signature mismatch\"\n );\n orderIdToPaymentStatus[orderId] = true;\n emit PaidForOrder(\n orderId,\n expirationTimestamp,\n orderSigner,\n msg.value,\n msg.sender\n );\n }\n\n /// @notice Called by a withdrawer to withdraw the entire balance of\n /// OrderPayable to `recipient`\n /// @param recipient Recipient address\n /// @return amount Withdrawal amount\n function withdraw(\n address recipient\n ) external override returns (uint256 amount) {\n require(\n msg.sender == manager ||\n IAccessControlRegistry(accessControlRegistry).hasRole(\n withdrawerRole,\n msg.sender\n ),\n \"Sender cannot withdraw\"\n );\n amount = address(this).balance;\n emit Withdrew(recipient, amount);\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Transfer unsuccessful\");\n }\n}\n" + }, + "contracts/utils/OwnableCallForwarder.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\nimport \"./interfaces/IOwnableCallForwarder.sol\";\n\n/// @title Contract that forwards the calls that its owner sends\n/// @notice AccessControlRegistry users that want their access control tables\n/// to be transferrable (e.g., a DAO) will use this forwarder instead of\n/// interacting with it directly. There are cases where this transferrability\n/// is not desired, e.g., if the user is an Airnode and is immutably associated\n/// with a single address, in which case the manager will interact with\n/// AccessControlRegistry directly.\ncontract OwnableCallForwarder is Ownable, IOwnableCallForwarder {\n /// @param _owner Owner address\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @notice Forwards the calldata and the value to the target address if\n /// the sender is the owner and returns the data\n /// @param forwardTarget Target address that the calldata will be forwarded\n /// to\n /// @param forwardedCalldata Calldata to be forwarded to the target address\n /// @return returnedData Data returned by the forwarded call\n function forwardCall(\n address forwardTarget,\n bytes calldata forwardedCalldata\n ) external payable override onlyOwner returns (bytes memory returnedData) {\n returnedData = Address.functionCallWithValue(\n forwardTarget,\n forwardedCalldata,\n msg.value\n );\n }\n}\n" + }, + "contracts/utils/SelfMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./interfaces/ISelfMulticall.sol\";\n\n/// @title Contract that enables calls to the inheriting contract to be batched\n/// @notice Implements two ways of batching, one requires none of the calls to\n/// revert and the other tolerates individual calls reverting\n/// @dev This implementation uses delegatecall for individual function calls.\n/// Since delegatecall is a message call, it can only be made to functions that\n/// are externally visible. This means that a contract cannot multicall its own\n/// functions that use internal/private visibility modifiers.\n/// Refer to OpenZeppelin's Multicall.sol for a similar implementation.\ncontract SelfMulticall is ISelfMulticall {\n /// @notice Batches calls to the inheriting contract and reverts as soon as\n /// one of the batched calls reverts\n /// @param data Array of calldata of batched calls\n /// @return returndata Array of returndata of batched calls\n function multicall(\n bytes[] calldata data\n ) external override returns (bytes[] memory returndata) {\n uint256 callCount = data.length;\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n bool success;\n // solhint-disable-next-line avoid-low-level-calls\n (success, returndata[ind]) = address(this).delegatecall(data[ind]);\n if (!success) {\n bytes memory returndataWithRevertData = returndata[ind];\n if (returndataWithRevertData.length > 0) {\n // Adapted from OpenZeppelin's Address.sol\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndataWithRevertData)\n revert(\n add(32, returndataWithRevertData),\n returndata_size\n )\n }\n } else {\n revert(\"Multicall: No revert string\");\n }\n }\n unchecked {\n ind++;\n }\n }\n }\n\n /// @notice Batches calls to the inheriting contract but does not revert if\n /// any of the batched calls reverts\n /// @param data Array of calldata of batched calls\n /// @return successes Array of success conditions of batched calls\n /// @return returndata Array of returndata of batched calls\n function tryMulticall(\n bytes[] calldata data\n )\n external\n override\n returns (bool[] memory successes, bytes[] memory returndata)\n {\n uint256 callCount = data.length;\n successes = new bool[](callCount);\n returndata = new bytes[](callCount);\n for (uint256 ind = 0; ind < callCount; ) {\n // solhint-disable-next-line avoid-low-level-calls\n (successes[ind], returndata[ind]) = address(this).delegatecall(\n data[ind]\n );\n unchecked {\n ind++;\n }\n }\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 1000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/deployments/deployment-block-numbers.json b/deployments/deployment-block-numbers.json index 59e0ab66..d72baae6 100644 --- a/deployments/deployment-block-numbers.json +++ b/deployments/deployment-block-numbers.json @@ -30,10 +30,12 @@ "59140": "linea-goerli-testnet", "59144": "linea", "80001": "polygon-testnet", + "81457": "blast", "84531": "base-goerli-testnet", "421613": "arbitrum-goerli-testnet", "534353": "scroll-goerli-testnet", "11155111": "ethereum-sepolia-testnet", + "168587773": "blast-sepolia-testnet", "736160594": "oev-network-sepolia-testnet" }, "AccessControlRegistry": { @@ -67,10 +69,12 @@ "59140": 2504514, "59144": 1094473, "80001": 43292190, + "81457": 114753, "84531": 13379012, "421613": 58263197, "534353": 5856670, "11155111": 4840249, + "168587773": 1693125, "736160594": 40 }, "OwnableCallForwarder": { @@ -104,10 +108,12 @@ "59140": 1121437, "59144": 412567, "80001": 33096187, + "81457": 114757, "84531": 7033014, "421613": 11400057, "534353": 3833210, "11155111": 3087218, + "168587773": 1693140, "736160594": 41 }, "Api3ServerV1": { @@ -141,10 +147,12 @@ "59140": 2504859, "59144": 1094475, "80001": 43292193, + "81457": 114801, "84531": 13379149, "421613": 58263206, "534353": 5856671, "11155111": 4840540, + "168587773": 1693147, "736160594": 43 }, "ProxyFactory": { @@ -178,10 +186,12 @@ "59140": 2505015, "59144": 1094477, "80001": 43292197, + "81457": 114806, "84531": 13379153, "421613": 58263211, "534353": 5856672, "11155111": 4840541, + "168587773": 1693151, "736160594": 44 }, "OrderPayable": { @@ -200,9 +210,10 @@ "8453": 7586583, "42161": 157788064, "43114": 38740595, - "59144": 1109154 + "59144": 1109154, + "81457": 114826 }, "RequesterAuthorizerWithErc721": { "11155111": 4884924 } -} +} \ No newline at end of file diff --git a/deployments/manager-multisig.json b/deployments/manager-multisig.json index 33056037..4cf95cbe 100644 --- a/deployments/manager-multisig.json +++ b/deployments/manager-multisig.json @@ -5,6 +5,7 @@ "avalanche": "0xC3E76D8829259f2A34541746de2F8A0509Dc1987", "base": "0x14A9E40FcAdA95A273ce3c8d4ccF7EA3280BDd26", "base-goerli-testnet": "0x14A9E40FcAdA95A273ce3c8d4ccF7EA3280BDd26", + "blast": "0x14A9E40FcAdA95A273ce3c8d4ccF7EA3280BDd26", "bsc-testnet": "0xd8eC2c4158a0Cb65Dd42E2d1C1da8EA11975Ba22", "bsc": "0x4923968942E8aae4656ae4913874EB7312e0F7c7", "cronos-testnet": "0x14A9E40FcAdA95A273ce3c8d4ccF7EA3280BDd26", diff --git a/deployments/references.json b/deployments/references.json index e8cc6355..ce3a74f1 100644 --- a/deployments/references.json +++ b/deployments/references.json @@ -30,10 +30,12 @@ "59140": "linea-goerli-testnet", "59144": "linea", "80001": "polygon-testnet", + "81457": "blast", "84531": "base-goerli-testnet", "421613": "arbitrum-goerli-testnet", "534353": "scroll-goerli-testnet", "11155111": "ethereum-sepolia-testnet", + "168587773": "blast-sepolia-testnet", "736160594": "oev-network-sepolia-testnet" }, "AccessControlRegistry": { @@ -67,10 +69,12 @@ "59140": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "59144": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "80001": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "81457": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "84531": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "421613": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "534353": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "11155111": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", + "168587773": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730", "736160594": "0xcD7Df573B0F0bb4F2f8dFFF6650cDe8C77431730" }, "OwnableCallForwarder": { @@ -104,10 +108,12 @@ "59140": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "59144": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "80001": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "81457": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "84531": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "421613": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "534353": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "11155111": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", + "168587773": "0x81bc85f329cDB28936FbB239f734AE495121F9A6", "736160594": "0x81bc85f329cDB28936FbB239f734AE495121F9A6" }, "Api3ServerV1": { @@ -141,10 +147,12 @@ "59140": "0x709944a48cAf83535e43471680fDA4905FB3920a", "59144": "0x709944a48cAf83535e43471680fDA4905FB3920a", "80001": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "81457": "0x709944a48cAf83535e43471680fDA4905FB3920a", "84531": "0x709944a48cAf83535e43471680fDA4905FB3920a", "421613": "0x709944a48cAf83535e43471680fDA4905FB3920a", "534353": "0x709944a48cAf83535e43471680fDA4905FB3920a", "11155111": "0x709944a48cAf83535e43471680fDA4905FB3920a", + "168587773": "0x709944a48cAf83535e43471680fDA4905FB3920a", "736160594": "0x709944a48cAf83535e43471680fDA4905FB3920a" }, "ProxyFactory": { @@ -178,10 +186,12 @@ "59140": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "59144": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "80001": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "81457": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "84531": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "421613": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "534353": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "11155111": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", + "168587773": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD", "736160594": "0x9EB9798Dc1b602067DFe5A57c3bfc914B965acFD" }, "OrderPayable": { @@ -200,9 +210,10 @@ "8453": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "42161": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", "43114": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", - "59144": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C" + "59144": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C", + "81457": "0xA1939e84e3aa466a9A16153dC9C39411B50FD20C" }, "RequesterAuthorizerWithErc721": { "11155111": "0x8e0b4538f4f6D94D3dF9b30D17E31D4C3Be9dA30" } -} +} \ No newline at end of file diff --git a/example.env b/example.env index 0587cca2..111c5831 100644 --- a/example.env +++ b/example.env @@ -4,7 +4,9 @@ ETHERSCAN_API_KEY_ARBITRUM_NOVA="" ETHERSCAN_API_KEY_ARBITRUM="" ETHERSCAN_API_KEY_AVALANCHE_TESTNET="" ETHERSCAN_API_KEY_AVALANCHE="" +ETHERSCAN_API_KEY_BASE_SEPOLIA_TESTNET="" ETHERSCAN_API_KEY_BASE="" +ETHERSCAN_API_KEY_BLAST="" ETHERSCAN_API_KEY_BOBA_ETHEREUM="" ETHERSCAN_API_KEY_BSC_TESTNET="" ETHERSCAN_API_KEY_BSC="" @@ -20,6 +22,7 @@ ETHERSCAN_API_KEY_MOONBEAM_TESTNET="" ETHERSCAN_API_KEY_MOONBEAM="" ETHERSCAN_API_KEY_MOONRIVER="" ETHERSCAN_API_KEY_OPTIMISM_GOERLI_TESTNET="" +ETHERSCAN_API_KEY_OPTIMISM_SEPOLIA_TESTNET="" ETHERSCAN_API_KEY_OPTIMISM="" ETHERSCAN_API_KEY_POLYGON_TESTNET="" ETHERSCAN_API_KEY_POLYGON_ZKEVM_GOERLI_TESTNET="" @@ -33,8 +36,10 @@ HARDHAT_HTTP_RPC_URL_AURORA="" HARDHAT_HTTP_RPC_URL_AVALANCHE_TESTNET="" HARDHAT_HTTP_RPC_URL_AVALANCHE="" HARDHAT_HTTP_RPC_URL_BASE_GOERLI_TESTNET="" +HARDHAT_HTTP_RPC_URL_BASE_SEPOLIA_TESTNET="" HARDHAT_HTTP_RPC_URL_BASE="" -HARDHAT_HTTP_RPC_URL_BOBA_AVALANCHE="" +HARDHAT_HTTP_RPC_URL_BLAST_SEPOLIA_TESTNET="" +HARDHAT_HTTP_RPC_URL_BLAST="" HARDHAT_HTTP_RPC_URL_BOBA_BNB="" HARDHAT_HTTP_RPC_URL_BOBA_ETHEREUM="" HARDHAT_HTTP_RPC_URL_BSC_TESTNET="" @@ -51,6 +56,8 @@ HARDHAT_HTTP_RPC_URL_GODWOKEN_TESTNET="" HARDHAT_HTTP_RPC_URL_GODWOKEN="" HARDHAT_HTTP_RPC_URL_KAVA_TESTNET="" HARDHAT_HTTP_RPC_URL_KAVA="" +HARDHAT_HTTP_RPC_URL_LIGHTLINK_GOERLI_TESTNET="" +HARDHAT_HTTP_RPC_URL_LIGHTLINK="" HARDHAT_HTTP_RPC_URL_LINEA_GOERLI_TESTNET="" HARDHAT_HTTP_RPC_URL_LINEA="" HARDHAT_HTTP_RPC_URL_MANTLE_GOERLI_TESTNET="" @@ -62,7 +69,10 @@ HARDHAT_HTTP_RPC_URL_MILKOMEDA_C1="" HARDHAT_HTTP_RPC_URL_MOONBEAM_TESTNET="" HARDHAT_HTTP_RPC_URL_MOONBEAM="" HARDHAT_HTTP_RPC_URL_MOONRIVER="" +HARDHAT_HTTP_RPC_URL_OEV_NETWORK_SEPOLIA_TESTNET_HACKATHON="" +HARDHAT_HTTP_RPC_URL_OEV_NETWORK_SEPOLIA_TESTNET="" HARDHAT_HTTP_RPC_URL_OPTIMISM_GOERLI_TESTNET="" +HARDHAT_HTTP_RPC_URL_OPTIMISM_SEPOLIA_TESTNET="" HARDHAT_HTTP_RPC_URL_OPTIMISM="" HARDHAT_HTTP_RPC_URL_POLYGON_TESTNET="" HARDHAT_HTTP_RPC_URL_POLYGON_ZKEVM_GOERLI_TESTNET="" diff --git a/package.json b/package.json index 52d73d0a..63e58fcd 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "write-env-file-example": "node scripts/write-env-file-example" }, "devDependencies": { - "@api3/chains": "^4.6.0", + "@api3/chains": "^4.11.0", "@api3/promise-utils": "^0.3.0", "@ethersproject/abi": "^5.4.7", "@ethersproject/providers": "^5.4.7", diff --git a/src/supported-chains.js b/src/supported-chains.js index 15980a3b..403ce1d6 100644 --- a/src/supported-chains.js +++ b/src/supported-chains.js @@ -3,6 +3,7 @@ module.exports = { 'arbitrum', 'avalanche', 'base', + 'blast', 'bsc', 'ethereum', 'fantom', @@ -25,6 +26,8 @@ module.exports = { 'avalanche-testnet', 'base', 'base-goerli-testnet', + 'blast', + 'blast-sepolia-testnet', 'bsc', 'bsc-testnet', 'cronos-testnet', diff --git a/yarn.lock b/yarn.lock index 167e6a7e..6c36842f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== -"@api3/chains@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@api3/chains/-/chains-4.6.0.tgz#5db8d8f4c7a923b21073bb9f1ab19e2bb0f3a3f7" - integrity sha512-xvPCK828aZPBNzUE7Ta2kMvvz4apXWxqgjMtjYX7rsYpoKDE5j7DYXPrJHpuA/nWuzrhlsRY8MqYaISyPU0XVw== +"@api3/chains@^4.11.0": + version "4.11.0" + resolved "https://registry.yarnpkg.com/@api3/chains/-/chains-4.11.0.tgz#d519c6a018c6737999a910301d497c743924d853" + integrity sha512-hEtqsn1HGMS/TfsoViIpudNy2G8DaTvbVzH1rTWSGsQRFCKc0PqNYvEAVPvEY4Aec7lM76bdf6c5HsAD4LzuIw== dependencies: viem "^2.7.1" zod "^3.22.4"